This directory contains the Python backend for the Pokémon GO Event Notifier project. The backend is responsible for scraping event information, processing it with a series of LLMs, and storing it in DynamoDB.
The backend is a data processing pipeline that performs the following steps:
pokemongolive.com and leekduck.com.A key feature of this backend is its multi-stage approach to data refinement using several targeted LLM calls. This strategy, favoring multiple, specialized calls to smaller models over a single call to a large one, ensures both high data quality and cost-effectiveness.
correct_event_type) analyzes the event’s details to fix common classification errors (e.g., correctly identifying a “Live Event” based on a city name in the summary).Since the same event is often announced on multiple sites with slightly different wording and timing, a sophisticated deduplication process is required.
are_events_duplicates_llm) determines if the two events are semantically the same, despite differences in their descriptions.choose_better_event_llm) compares the two JSON objects and selects the one with the most complete and specific information (e.g., preferring an exact time over a placeholder, or a more descriptive summary). This ensures the data stored in the database is of the highest possible quality.git clone [https://github.com/sthoresen/go-event-alerts.git](https://github.com/sthoresen/go-event-alerts.git)
cd go-event-alerts/backend
python -m venv venv
source venv/bin/activate # On Windows, use `venv\Scripts\activate`
pip install -r requirements.txt
The backend requires the following environment variables to be set in a .env file:
OPENAI_API_KEY: Your API key for OpenAI.AWS_ACCESS_KEY_ID: Your AWS access key.AWS_SECRET_ACCESS_KEY: Your AWS secret access key.AWS_REGION: The AWS region where your DynamoDB tables are located.To run the data processing pipeline manually, execute the lambda_function.py script:
```bash python lambda_function.py