Text Classification
fastText
language-identification
MariaFjodorowa commited on
Commit
8f7f20a
·
verified ·
1 Parent(s): 64c9f52

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +4 -2
README.md CHANGED
@@ -45,7 +45,9 @@ def preprocess(text):
45
  text = regex.sub(NONWORD_REPLACE_PATTERN, "", text)
46
  return text
47
 
48
- model_path = hf_hub_download(repo_id="HPLT/OpenLID-v3", filename="openlid-v3.bin") # may take some time
 
 
49
  model = fasttext.load_model(model_path)
50
  text = "Maskinsjefen er oppteken av å løfta fram dei maritime utdanningane."
51
  text = preprocess(text)
@@ -55,7 +57,7 @@ print(
55
  k=1,
56
  threshold=0.5,
57
  on_unicode_error="strict",
58
- ),
59
  )
60
  # should output: (('__label__nno_Latn',), array([0.99999893]))
61
  ```
 
45
  text = regex.sub(NONWORD_REPLACE_PATTERN, "", text)
46
  return text
47
 
48
+ model_path = hf_hub_download(
49
+ repo_id="HPLT/OpenLID-v3", filename="openlid-v3.bin",
50
+ ) # may take some time
51
  model = fasttext.load_model(model_path)
52
  text = "Maskinsjefen er oppteken av å løfta fram dei maritime utdanningane."
53
  text = preprocess(text)
 
57
  k=1,
58
  threshold=0.5,
59
  on_unicode_error="strict",
60
+ ),
61
  )
62
  # should output: (('__label__nno_Latn',), array([0.99999893]))
63
  ```