First, add repository to your build.gradle file
Kotlin Gradle Script & Gradle
maven{
url = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
}
Second, add QA Engine dependency to build.gradle
-
Gradle
implementation "io.github.ssu-isteam:QAEngine:1.0-SNAPSHOT"
-
Kotlin Gradle Script
implementation("io.github.ssu-isteam:QAEngine:1.0-SNAPSHOT")
All examples are coded in Kotlin
-
Create dataset loader :Currently supported dataset loader is MINDsLabDataSetLoader
var loader = MINDsLabDataSetLoader("your_mindslab_dataset.json")
//Also, you can add mutliple dataset loader. var loader2 = MINDsLabDataSetLoader("dataset2.json")
-
Prepare your network model and vocab cache path for TfidVectorizer
-
Initialize QAEngine and invoke initEngine() method with parameters prepared above.
var engine = QAEngine() //initEngine has data set loader array parameters to load multiple datasets and merge them to one dataset. engine.initEngine(model_path,vocab_cache_path, loader,loader2....)
-
Well done! It's now time to get the answer of a question
var answerText = engine.getAnswer(questionText)