/deprem_openai_apis

OpenAI APIs for Earthquake Related Tasks

Primary LanguagePython

Address and Intent Extractor

The code can extract adresses from raw Turkiye earthquake tweets and classify them for intent via OpenAI GPT Codex API by using few-shot prompting.

How To Run

Currently the input format is .jsonl where each line has a json string with "Tweet" field, see an example input file here data/test.jsonl.

Export two environment variables as comma seperated keys:

export OPENAI_API_KEY_POOL=key1,key2,key3...
export GEO_KEY_POOL=key1,key2

optionally for afet org api base urls

export OPENAI_API_BASE_POOL=

To extract the geo location address information:

./run_address.sh

To extract the intent information:

./run_intent.sh

To Run FastAPI Backend

  • To run locally uvicorn main:app --reload

Running github actions