File tree Expand file tree Collapse file tree
src/main/java/nie/translator/rtranslator/voice_translation/neural_networks/translation Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -129,8 +129,6 @@ dependencies {
129129 implementation " ai.djl.android:core:0.33.0"
130130 implementation " ai.djl.huggingface:tokenizers:0.33.0"
131131 implementation " ai.djl.android:tokenizer-native:0.33.0"
132- // DJL fasttext wrapper
133- implementation ' ai.djl.fasttext:fasttext-engine:0.33.0'
134132 // protobuf
135133 implementation " com.google.protobuf:protobuf-javalite:4.33.5"
136134 // bouncycastle crypto lib
@@ -146,8 +144,6 @@ dependencies {
146144 // ONNX Runtime
147145 implementation ' com.microsoft.onnxruntime:onnxruntime-android:1.23.2' // latest.release
148146 implementation ' com.microsoft.onnxruntime:onnxruntime-extensions-android:0.13.0' // latest.release
149- // Ml-Kit
150- // implementation 'com.google.mlkit:language-id:17.0.5'
151147 // JWS parser
152148 implementation group : ' com.nimbusds' , name : ' nimbus-jose-jwt' , version : ' 5.1'
153149 implementation files(' libs/sqlite4java-android-release.aar' )
Original file line number Diff line number Diff line change 77
88import java .io .File ;
99import java .io .IOException ;
10- import java .nio .file .Paths ;
1110
1211import ai .djl .ModelException ;
13- import ai .djl .inference .Predictor ;
14- import ai .djl .modality .Classifications ;
15- import ai .djl .repository .zoo .Criteria ;
16- import ai .djl .repository .zoo .ZooModel ;
17- import ai .djl .translate .TranslateException ;
18- import nie .translator .rtranslator .voice_translation .neural_networks .NeuralNetworkApiResult ;
1912
2013public class LanguageDetector {
2114 // Load the C++ library
@@ -27,9 +20,6 @@ public class LanguageDetector {
2720 private static final String TAG = "LanguageDetector" ;
2821 private static final String MODEL_FILE_NAME = "fasttext.ftz" ;
2922
30- private ZooModel <String , Classifications > model ;
31- private Predictor <String , Classifications > predictor ;
32-
3323 private long nativePtr = 0 ;
3424 private Context context ;
3525
@@ -57,7 +47,7 @@ public void run() {
5747 Log .e (TAG , "Model not initialized." );
5848 listener .onSuccess ("und" );
5949 }
60- listener .onSuccess (predictLanguage (nativePtr , text ));
50+ listener .onSuccess (predictLanguage (nativePtr , text , confidenceThreshold ));
6151
6252 } catch (Exception e ) {
6353 e .printStackTrace ();
You can’t perform that action at this time.
0 commit comments