Weather Process Flow
Identify the City Name
"Aryan, Can you tell me Weather of New York?" Once the weather flow is triggered raw speech is passed to geography package geoPlace Function to identify the place from the raw speech.
geograpy extracts place names from a URL or text, and adds context to those names -- for example distinguishing between a country, region or city.
The extraction is a two step process.
The first process is a Natural Language Processing task which analyzes a text for potential mentions of geographic locations.
In the next step the words which represent such locations are looked up using the Locator.
If you already know that your content has geographic information you might want to use the Locator interface directly.
geograpy3 uses the following excellent libraries:
NLTK for entity recognition
newspaper for text extraction from HTML
jellyfish for fuzzy text match
pylodstorage for storage and retrieval of tabular data from SQL and SPARQL sources
geograpy3 uses the following data sources:
ISO3166ErrorDictionary for common country misspellings via Sara-Jayne Terp
Wikidata for country/region/city information with disambiguation via population
Once the location is identified, GetCityName flow is used to get the name of the city from places list. First occurrence of the city is selected.
In case of no city identified, an exception is raised and is handled by defaulting the city to home city.
Get the Weather Details for the City
Once you get the city name, next step is to use the city to have a API call to openweathermap using the pre-defined API key to get the current weather information.
Response of API is captured in JSON dump for further parsing.
API calls to OpenWeatherMap is used by Aryan to source the weather information, it allows Aryan to
Access current weather data for any location including over 200,000 cities
The weather data is collected from different sources such as global and local weather models, satellites, radars and a vast network of weather stations
Get the Weather Description and Temperature
Once the JSON Dump is received, Aryan parses the JSON file which is enriched with weather information to get the temperature and weather description. This real time information is then provided to Human
Last updated
Was this helpful?