This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from fastapi import FastAPI | |
| from pydantic import BaseModel | |
| from utils.nlp import extract_ents | |
| from utils.twitter_api import get_response | |
| app = FastAPI() | |
| class Query(BaseModel): | |
| keyword: str | |
| max_results: int |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import spacy | |
| import re | |
| ner = spacy.load('trf_ner\model-best') | |
| def test_model(): | |
| ''' | |
| Check if the model is loaded properly | |
| ''' | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| from dotenv import load_dotenv | |
| import requests | |
| #load your credentials through the .env file | |
| load_dotenv() | |
| def create_headers(): | |
| api_key = os.getenv('api_key') |
OlderNewer