Spaces:
Sleeping
Sleeping
Update Demo.py
Browse files
Demo.py
CHANGED
|
@@ -548,8 +548,9 @@ language_map = {
|
|
| 548 |
'zza': "Zaza"
|
| 549 |
}
|
| 550 |
|
| 551 |
-
|
| 552 |
-
|
|
|
|
| 553 |
|
| 554 |
-
st.markdown(f"This text is in **{language} ({
|
| 555 |
st.markdown(f"Classification Confidence: **{confidence}%**")
|
|
|
|
| 548 |
'zza': "Zaza"
|
| 549 |
}
|
| 550 |
|
| 551 |
+
abbreviation = output['language'][0].result
|
| 552 |
+
language = language_map[abbreviation]
|
| 553 |
+
confidence = round(float(output['language'][0].metadata[abbreviation])*100, 2)
|
| 554 |
|
| 555 |
+
st.markdown(f"This text is in **{language} ({abbreviation})** language.")
|
| 556 |
st.markdown(f"Classification Confidence: **{confidence}%**")
|