Skip to content

Instantly share code, notes, and snippets.

@wfng92
Created March 18, 2021 03:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wfng92/509f8c83d366b3d7ef35f71caeaf751b to your computer and use it in GitHub Desktop.
Save wfng92/509f8c83d366b3d7ef35f71caeaf751b to your computer and use it in GitHub Desktop.
import gcld3
detector = gcld3.NNetLanguageIdentifier(min_num_bytes=0, max_num_bytes=1000)
sample = "Welcome to Medium."
result = detector.FindLanguage(text=sample)
print(result.language, result.is_reliable, result.proportion, result.probability)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment