Hossein
Hossein

Reputation: 847

Firebase ML KIT cannot recognize gujarati language

I'm using ml kit cloud text recognition by java, and it works perfectly for all languages except Gujarati.

i cant understand whats wrong, i did also add "gu" language to recognition options but it didn't matter. whats wrong?

FirebaseVisionImage visionImage = FirebaseVisionImage.fromBitmap(myBitmap);
FirebaseVisionCloudTextRecognizerOptions options = new FirebaseVisionCloudTextRecognizerOptions.Builder()
        .setLanguageHints(Arrays.asList("gu"))
        .build();
FirebaseVisionTextRecognizer detector = FirebaseVision.getInstance()
        .getCloudTextRecognizer(options);

Task<FirebaseVisionText> result =
        detector.processImage(visionImage)
                .addOnSuccessListener(new OnSuccessListener<FirebaseVisionText>() {
                    @Override
                    public void onSuccess(FirebaseVisionText firebaseVisionText) {
                        Log.e("Recognition", "Text : " + firebaseVisionText.getText());
                    }
                })
                .addOnFailureListener(
                        new OnFailureListener() {
                            @Override
                            public void onFailure(@NonNull Exception e) {
                                Log.e(TAG, "Recognition failed : " + e.getMessage());
                            }
                        });

Upvotes: 1

Views: 796

Answers (2)

Shiyu
Shiyu

Reputation: 935

Have you tried the SPARSE_MODEL without the language hint? It should automatically detect the language. There is a known internal issue with 'gu' hint for SPARSE_MODEL, and we are working on it.

Also, you could also try to use DENSE_MODEL instead of SPARSE_MODEL with the language hint.

FirebaseVisionCloudTextRecognizerOptions options = new FirebaseVisionCloudTextRecognizerOptions.Builder()
        .setLanguageHints(Arrays.asList("gu"))
        .setModelType(FirebaseVisionCloudTextRecognizerOptions.DENSE_MODEL)
        .build();

Upvotes: 1

Hossein
Hossein

Reputation: 847

I had communications with cloud support, and it turned out that problem is from their side, and they are working on that.

Upvotes: 1

Related Questions