Simon Clematide
commited on
Commit
·
b99687f
1
Parent(s):
a4f7d29
Add Floret language identifier wrapper
Browse files
impresso_langident_wrapper.py
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import floret # Assuming Floret is already installed
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
class FloretLangIdentifier:
|
| 5 |
+
def __init__(self, model_path):
|
| 6 |
+
self.model = floret.load_model(model_path)
|
| 7 |
+
|
| 8 |
+
def predict(self, text):
|
| 9 |
+
predictions = self.model.predict(text)
|
| 10 |
+
return predictions
|