[Detectlanguage]When I try Language Detection API (detectlanguage).

N00K
2 min readJan 14, 2019

--

In free time of my working day. I try to learn something in short break. While surfing internet I have visit github website and find interesting topic about “detectlanguage” from “https://github.com/pmoelgaard/detectlanguage” then while working just imagine today I have to try this API with my style. Finally evening coming. Let’s try on python language.

First I go to this website for https://detectlanguage.com/private for go to pick API key.

Second step I use “pip install detectlanguage” in CMD.

From image I already installed, then everything ready for import to using. from picture just show you in step How to set pip installation.

Let’s do a few line of code.. ^^

>>> import detectlanguage #import from installing to using

>>>detectlanguage.configuration.api_key=”Key” #this step for set your key from the first step above

>> > detectlanguage.detect(“Sentence or word in any language”) #for detect which language from input

As the image I try to detect various language.

As the Image I try to mix any language together just want to see the result how it’s work. Yey!! IsReliable = “False” but language still detect in “th” even I try to switch the position of word but it’s still detect as “th”.

From Image When I try to detect a number as string and as interger type.

When I make list of various type of language and try to use “detectlanguage”

Finally I think can implement this API for useful in any work as you think. Thank you for reading my first crazy content ^_^.

--

--

N00K
N00K

Written by N00K

I’m a developer. I’m easy to be happy when get knowledge about ML and ice cream. Taking a beautiful picture of the nature is my favorite.

No responses yet