Spaces:
Running
Running
Update services/location_service.py
Browse files
services/location_service.py
CHANGED
@@ -27,7 +27,7 @@ class LocationService:
|
|
27 |
|
28 |
|
29 |
@staticmethod
|
30 |
-
def get_coordinates(data:dict) -> Coordinates | ErrorResponse:
|
31 |
print("Inside get coordinates")
|
32 |
print(data)
|
33 |
try:
|
@@ -41,7 +41,7 @@ class LocationService:
|
|
41 |
|
42 |
if location:
|
43 |
# Assuming `app.nlp` is already initialized elsewhere and accessible
|
44 |
-
ner_results =
|
45 |
|
46 |
# Extract city, state, and country using the logic from extract_location_entities
|
47 |
location_entities = LocationService.extract_location_entities(ner_results)
|
|
|
27 |
|
28 |
|
29 |
@staticmethod
|
30 |
+
def get_coordinates(data:dict,model) -> Coordinates | ErrorResponse:
|
31 |
print("Inside get coordinates")
|
32 |
print(data)
|
33 |
try:
|
|
|
41 |
|
42 |
if location:
|
43 |
# Assuming `app.nlp` is already initialized elsewhere and accessible
|
44 |
+
ner_results = model(location)
|
45 |
|
46 |
# Extract city, state, and country using the logic from extract_location_entities
|
47 |
location_entities = LocationService.extract_location_entities(ner_results)
|