Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -51,6 +51,27 @@ def get_prediction(text):
|
|
| 51 |
|
| 52 |
return response, keywords, influential_keywords
|
| 53 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
def predict(text):
|
| 55 |
greeting_pattern = r"^(Halló|Hæ|Sæl|Góðan dag|Kær kveðja|Daginn|Kvöldið|Ágætis|Elsku)"
|
| 56 |
|
|
@@ -94,7 +115,6 @@ def predict(text):
|
|
| 94 |
|
| 95 |
return response
|
| 96 |
|
| 97 |
-
|
| 98 |
description_html = """
|
| 99 |
<center>
|
| 100 |
<img src='http://www.ru.is/media/HR_logo_vinstri_transparent.png' width='250' height='auto'>
|
|
|
|
| 51 |
|
| 52 |
return response, keywords, influential_keywords
|
| 53 |
|
| 54 |
+
def replace_encoding(tokens):
|
| 55 |
+
return [token.replace('Ġ', ' ')
|
| 56 |
+
.replace('ð', 'ð')
|
| 57 |
+
.replace('é', 'é')
|
| 58 |
+
.replace('æ', 'æ')
|
| 59 |
+
.replace('ý', 'ý')
|
| 60 |
+
.replace('á', 'á')
|
| 61 |
+
.replace('ú', 'ú')
|
| 62 |
+
.replace('ÃŃ', 'í')
|
| 63 |
+
.replace('Ãö', 'ö')
|
| 64 |
+
.replace('þ', 'þ')
|
| 65 |
+
.replace('Ãģ', 'Á')
|
| 66 |
+
.replace('Ãį', 'Ú')
|
| 67 |
+
.replace('Ãĵ', 'Ó')
|
| 68 |
+
.replace('ÃĨ', 'Æ')
|
| 69 |
+
.replace('ÃIJ', 'Ð')
|
| 70 |
+
.replace('Ãĸ', 'Ö')
|
| 71 |
+
.replace('Ãī', 'É')
|
| 72 |
+
.replace('Ãļ', 'ý')
|
| 73 |
+
for token in tokens[1:-1]]
|
| 74 |
+
|
| 75 |
def predict(text):
|
| 76 |
greeting_pattern = r"^(Halló|Hæ|Sæl|Góðan dag|Kær kveðja|Daginn|Kvöldið|Ágætis|Elsku)"
|
| 77 |
|
|
|
|
| 115 |
|
| 116 |
return response
|
| 117 |
|
|
|
|
| 118 |
description_html = """
|
| 119 |
<center>
|
| 120 |
<img src='http://www.ru.is/media/HR_logo_vinstri_transparent.png' width='250' height='auto'>
|