Omkar008 commited on
Commit
ee270e3
·
verified ·
1 Parent(s): 7260284

Update services/location_service.py

Browse files
Files changed (1) hide show
  1. services/location_service.py +2 -2
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 = self.app.state.nlp(location)
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)