Weather Predictor

From UBC Wiki

Course:CPSC-312-2019-Prolog-Weather-Predictor

Authors: Gurveer Kaur

Contents

[hide]

What is the problem?[edit | wikitext]

Writing a program that matches cities or countries that matches the required weather conditions.  This can be useful in destination planning as per the weather conditions. Users can input a query with given preconditions like temperature, humidity, pressure etc to predict list of areas in a City/Country where the weather is favourable as per the specified criteria.

What is the something extra?[edit | wikitext]

Obtaining API response in Prolog and handling large objects in JSON format. Weather API returns hourly data, thus have to apply filters to get required result. This includes obtaining latitude and longitude from geocoder API to communicate with open weather map API. Additionaly, Natural Language Processing was applied to obtain and process user queries and integrate them with web API. As part of the feasibility test, the results from API responses using different filters were compared.

What did we learn from doing this?[edit | wikitext]

  1. Calling open weather API in Prolog and extracting weather parameters like temperature, pressure in JSON format.
  2. Understanding large object parsing in JSON as well as handling API response in Prolog.
  3. Implementing constraints on weather parameters as per the needs of users.
  4. Finding API response time in returning the data.
  5. Additionaly, implemented Natural Language processing (NLP) on user fed queries related to weather.
  6. Utilizing parameters from NLP to call open weather API.
  7. Obtaining contrast between the API response obtained from hard coded queries and Naturally processed queries keeping similar weather constraints.
  8. Realized usefulness of Prolog in coordinating various activities based on user's goals and preferences and in obtaining quick response.

Links to code etc[edit | wikitext]

GitHub: https://github.com/Gurveer90/Weather_Predictor_Prolog

References:

API call in Prolog: http://www.paulbrownmagic.com/blog/swi_prolog_json_api_consume.html

API OpenWeather: https://openweathermap.org/api