Spaces:
Runtime error
Runtime error
Commit ·
27961e6
1
Parent(s): bdd0001
Update main.py
Browse files
main.py
CHANGED
|
@@ -1,27 +1,9 @@
|
|
| 1 |
-
import time
|
| 2 |
-
|
| 3 |
-
print("\n\n ==== THE NATURAL LANGUAGE MODULE IS BEING LOADED. PLEASE WAIT ==== \n\n")
|
| 4 |
-
start_time_load = time.time()
|
| 5 |
-
|
| 6 |
-
from transformers import logging
|
| 7 |
-
logging.set_verbosity_error()
|
| 8 |
-
|
| 9 |
-
import warnings
|
| 10 |
-
warnings.filterwarnings("ignore", category=UserWarning)
|
| 11 |
-
|
| 12 |
-
import sys
|
| 13 |
-
|
| 14 |
-
import requests
|
| 15 |
-
|
| 16 |
from countriesIdentification import identify_locations
|
| 17 |
from datesIdentification import dates_binding
|
| 18 |
from magnitudeIdentification import magnitude_binding
|
| 19 |
from comparativesIdentification import comparatives_binding
|
| 20 |
from earthquaqeIdentification import identify_earthquake_event
|
| 21 |
|
| 22 |
-
spacy.cli.download("en_core_web_sm")
|
| 23 |
-
spacy.cli.download("en_core_web_lg")
|
| 24 |
-
|
| 25 |
|
| 26 |
def process_final_dict(final_dictionary):
|
| 27 |
"""
|
|
@@ -178,6 +160,9 @@ def main(sentence):
|
|
| 178 |
Function to bind together all the info and be executed
|
| 179 |
"""
|
| 180 |
|
|
|
|
|
|
|
|
|
|
| 181 |
nl_data = natural_language_module(sentence)
|
| 182 |
nl_json = process_json_sf(nl_data, sentence)
|
| 183 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
from countriesIdentification import identify_locations
|
| 2 |
from datesIdentification import dates_binding
|
| 3 |
from magnitudeIdentification import magnitude_binding
|
| 4 |
from comparativesIdentification import comparatives_binding
|
| 5 |
from earthquaqeIdentification import identify_earthquake_event
|
| 6 |
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
def process_final_dict(final_dictionary):
|
| 9 |
"""
|
|
|
|
| 160 |
Function to bind together all the info and be executed
|
| 161 |
"""
|
| 162 |
|
| 163 |
+
spacy.cli.download("en_core_web_sm")
|
| 164 |
+
spacy.cli.download("en_core_web_lg")
|
| 165 |
+
|
| 166 |
nl_data = natural_language_module(sentence)
|
| 167 |
nl_json = process_json_sf(nl_data, sentence)
|
| 168 |
|