Java version (Not Java?)
Behaiv is a high-level AI tool that helps users to navigate faster through the app, predict what users want to open and take appropriate actions. It was developed with a focus on simplicity of usage. Instead of overwhelming developers with burden of implementation, they only need to write few lines of code.
(Largely inspired by app suggestion in IOS.)
Main object in Behaiv is, in fact, Behaiv
.
This is the class that you'll access all the time.
To init this class, use a static method Behaiv.with(id)
where id is unique value that will be used to restore your data on restart.
Behaiv itself is a semi-builder, you don't need to call .build()
on it.
In upcoming version you'll be able to add more providers any time.
Behaiv behaiv = new Behaiv.Builder("myId")
.setProvider(new DayTimeProvider())
// add more providers
.setStorage(new SimpleStorage(storageDirectoryFile))
.build();
Done, in order to start capturing user's behavior you need to call next methods:
behaiv.startCapturing(predict)
in order to start capturing parameters for prediction, it takes optional variable to trigger prediction, if it's false, it won't predict.behaiv.startCapturing()
will trigger providers to get all the data needed for prediction.behaiv.registerLabel(label)
to attach label or result of parameters. Without it data won't be saved.behaiv.stopCapturing(discard)
to save and train network if threshold is reached.
behaiv.startCapturing(true);
//user takes actions
behaiv.registerLabel("Lili_12345 chat")
behaiv.stopCapturing(false)
In order to use prediction, you need to subscribe for them. If behaiv.startCapturing(false) was used, you won't receive prediction
//call this before behaiv.startCapturing(true);
behaiv.subscribe().subscribe(predictionLabel -> {
// snow prediction on ui
});
That's all, everything else is handled by Behaiv
For more in-depth tutorial about Behaiv you can checkout:
- Why user behavior prediction is the next big thing in mobile and web? in becominghuman.ai
- Add dependency as in gradle section
- Instantiate
Behaiv.Builder
object inApplication
withnew Behaiv.Builder(id)
- If needed, change Kernel type with
.setKernel(Kernel)
on a Builder(deprecated)DummyKernel
doesn't do any computations, only suggest most similar result by comparing count of stepsLogisticRegressionKernel
uses Logistic Regression to predict actions.RemoteKernel
(not implemented yet), sends data to a API, depending on type of an API receives suggested action or receives model
- Provide external factors with
Builder.setProvider()
such as GPS, Wifi/Bluetooth and headphons info.- Use
DayTimeProvider
to use time of a day as a features - Use
GpsProvider
for adding GPS feature into prediction from behaiv-android - Use
NetworkProvider
for adding Wifi, Bluetooth and Network features into prediction(TODO) - Use
HeadsetProvider
to include headphones feature into predcition(TODO) - There's more options like Weather and Firebase provides, see more at (TODO)
- Use
SyntheticProvider
to include custom self-made features into prediction (e.g)(TODO, can be implemented easily)
- Use
- Build
Behaiv
object by callingBuilder.build()
- Set threshold after which Behaiv can start suggesting with
.setThreshold(int)
- Subscribe to predictions in main view e.g
MainActivity
withbehaiv.subscribe().subscribe(predictionLabel -> {})
- When prediction received, do a switch/when and show option for user to open
- When view is ready for usage by user, call
behaiv.startCapturing(true)
e.g inonViewCreated()
oronCreate()
- Find objects to target(e.g chats with user) and when user clicks on target, execute
behaiv.registerLabel(String)
- At the same time call
behaiv.stopCapturing(false)
if you're sure that it's correct action.
Model uses "Continuous learning" so it will be trained as long as more features will arrive. To see model in action you need to wait amount of examples reach threshold.
We use jitpack for now. Beware that in near future we can migrate to different maven repository. Add it in your root build.gradle at the end of repositories:
Step 1. Add the JitPack repository to your build file
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Step 2. Add the dependency
dependencies {
implementation 'com.github.dmi3coder:behaiv-java:0.4.10-alpha'
}
Step 1. Add the JitPack repository to your build file
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Step 2. Add the dependency
<dependency>
<groupId>com.github.dmi3coder</groupId>
<artifactId>behaiv-java</artifactId>
<version>0.4.10-alpha</version>
</dependency>
Look at more information about build on Jitpack
Behaiv project is really open for help. If you want to help this project to shine, I firstly suggest you to contact me(Dmytro Chaban) by any convinient way e.g email. Second thing is to look at issues. Another way is to spread this project to your friends and contacts, it'll help bring more developers to this project. Reporting issues with project wont hurt also ;)
Behaiv has different implementations(though many of them is in progress of development).
Project | Language | Version/Arriving date | Developed by |
---|---|---|---|
behaiv-android(extension) | Java | dmi3coder | |
behaiv-swift | Swift | 2Q 2020 | DonauTech & dmi3coder |
behaiv-remote-kernel | Python(Backend) | DonauTech & dmi3coder | |
behaiv-js | JavaScript | 2Q 2020 | DonauTech & dmi3coder |