The Clarifai API supports many languages in addition to English. These are represented as translations of the names of concepts so that when you search by concept name or get predictions from a model's concepts you can utilize the language of your choice.
Supported Languages
The currently supported languages are listed below.
Language
Code
Arabic (ar)
ar
Bengali (bn)
bn
Danish (da)
da
German (de)
de
English (en)
en
Spanish (es)
es
Finnish (fi)
fi
French (fr)
fr
Hindi (hi)
hi
Hungarian (hu)
hu
Italian (it)
it
Japanese (ja)
ja
Korean (ko)
ko
Dutch (nl)
nl
Norwegian (no)
no
Punjabi (pa)
pa
Polish (pl)
pl
Portuguese (pt)
pt
Russian (ru)
ru
Swedish (sv)
sv
Turkish (tr)
tr
Chinese Simplified (zh)
zh
Chinese Traditional (zh-TW)
zh-TW
Default Language
When you create a new Application, you must specify a default language. This will be the default language concepts are returned in when you do not explicitly set a language in an API request. You cannot change the default language. You can however change languages per request.
List language translations by concept ID
You can see all the language translations for a given concept ID with a GET call. This call supports pagination.
import com.clarifai.grpc.api.*;
import com.clarifai.grpc.api.status.*;
// Insert here the initialization code as outlined on this page:
// https://docs.clarifai.com/api-guide/api-overview
MultiConceptResponse listConceptLanguagesResponse = stub.listConceptLanguages(
ListConceptLanguagesRequest.newBuilder()
.setConceptId("charlie")
.build()
);
if (listConceptLanguagesResponse.getStatus().getCode() != StatusCode.SUCCESS) {
throw new RuntimeException("List concept languages failed, status: " + listConceptLanguagesResponse.getStatus());
}
// Insert here the initialization code as outlined on this page:
// https://docs.clarifai.com/api-guide/api-overview
stub.ListConceptLanguages(
{
concept_id: "charlie"
},
metadata,
(err, response) => {
if (err) {
throw new Error(err);
}
if (response.status.code !== 10000) {
throw new Error("List concepts failed, status: " + response.status.description);
}
}
);
from clarifai_grpc.grpc.api import service_pb2, resources_pb2
from clarifai_grpc.grpc.api.status import status_code_pb2
# Insert here the initialization code as outlined on this page:
# https://docs.clarifai.com/api-guide/api-overview
list_concept_languages_response = stub.ListConceptLanguages(
service_pb2.ListConceptLanguagesRequest(
concept_id="charlie"
),
metadata=metadata
)
if list_concept_languages_response.status.code != status_code_pb2.SUCCESS:
raise Exception("List concept failed, status: " + list_concept_languages_response.status.description)