tuva commited on
Commit
9f0ee73
1 Parent(s): 2a23f98

Added logistic regression language classifier model

Browse files
Files changed (2) hide show
  1. inference.py +6 -0
  2. model_card.md +3 -0
inference.py CHANGED
@@ -13,3 +13,9 @@ model = joblib.load(model_path)
13
  def predict(texts: List[str]):
14
  predictions = model.predict(texts)
15
  return predictions
 
 
 
 
 
 
 
13
  def predict(texts: List[str]):
14
  predictions = model.predict(texts)
15
  return predictions
16
+
17
+ def preprocess(text):
18
+ return [text]
19
+
20
+ def postprocess(prediction):
21
+ return {"label": int(prediction[0])}
model_card.md CHANGED
@@ -10,6 +10,9 @@ datasets:
10
  - custom
11
  metrics:
12
  - accuracy
 
 
 
13
  ---
14
 
15
  # Language Classifier
 
10
  - custom
11
  metrics:
12
  - accuracy
13
+ widget:
14
+ - text: "Пример текста на русском языке."
15
+ - text: "Бүс-текст"
16
  ---
17
 
18
  # Language Classifier