Spaces:
Runtime error
Runtime error
Add some beauty
Browse files
app.py
CHANGED
@@ -49,9 +49,9 @@ def reverse_geocode(lat, lon):
|
|
49 |
}
|
50 |
try:
|
51 |
r = requests.get('https://geocode.maps.co/reverse', params=payload)
|
52 |
-
return
|
53 |
except:
|
54 |
-
return "
|
55 |
|
56 |
def predict(text):
|
57 |
text = process_tweet(text)
|
@@ -63,7 +63,7 @@ def predict(text):
|
|
63 |
}
|
64 |
relevancy_label, relevancy_score = predict_relevancy(text)
|
65 |
if relevancy_label == 'relevant':
|
66 |
-
data['relevancy_score'] = relevancy_score
|
67 |
|
68 |
lat, lon = predict_coordinates(text)
|
69 |
data['lat'] = lat
|
|
|
49 |
}
|
50 |
try:
|
51 |
r = requests.get('https://geocode.maps.co/reverse', params=payload)
|
52 |
+
return r.json()['display_name']
|
53 |
except:
|
54 |
+
return "No data"
|
55 |
|
56 |
def predict(text):
|
57 |
text = process_tweet(text)
|
|
|
63 |
}
|
64 |
relevancy_label, relevancy_score = predict_relevancy(text)
|
65 |
if relevancy_label == 'relevant':
|
66 |
+
data['relevancy_score'] = round(relevancy_score * 100, 2)
|
67 |
|
68 |
lat, lon = predict_coordinates(text)
|
69 |
data['lat'] = lat
|