Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -9,15 +9,15 @@ from langdetect import detect, DetectorFactory
|
|
9 |
DetectorFactory.seed = 42
|
10 |
|
11 |
app = FastAPI()
|
12 |
-
|
13 |
-
|
14 |
|
15 |
|
16 |
def punctuate(text: str) -> str:
|
17 |
if detect(text) == "ur":
|
18 |
-
return
|
19 |
else:
|
20 |
-
return
|
21 |
|
22 |
|
23 |
title = "SELMA H2020 — Multilingual Punctuation & Casing Prediction"
|
|
|
9 |
DetectorFactory.seed = 42
|
10 |
|
11 |
app = FastAPI()
|
12 |
+
hf_model = Urdu()
|
13 |
+
nemo_model = MultiLingual()
|
14 |
|
15 |
|
16 |
def punctuate(text: str) -> str:
|
17 |
if detect(text) == "ur":
|
18 |
+
return hf_model.punctuate(text)
|
19 |
else:
|
20 |
+
return nemo_model.punctuate(text)
|
21 |
|
22 |
|
23 |
title = "SELMA H2020 — Multilingual Punctuation & Casing Prediction"
|