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 | |
| import sys | |
| sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) | |
| import asyncio | |
| from langchain_openai import ChatOpenAI | |
| from langchain_anthropic import ChatAnthropic | |
| from langchain_google_genai import ChatGoogleGenerativeAI |
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
| { | |
| "n01440764": "tench", | |
| "n01443537": "goldfish", | |
| "n01484850": "great_white_shark", | |
| "n01491361": "tiger_shark", | |
| "n01494475": "hammerhead", | |
| "n01496331": "electric_ray", | |
| "n01498041": "stingray", | |
| "n01514668": "cock", | |
| "n01514859": "hen", |
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
| n02119789 1 kit_fox | |
| n02100735 2 English_setter | |
| n02110185 3 Siberian_husky | |
| n02096294 4 Australian_terrier | |
| n02102040 5 English_springer | |
| n02066245 6 grey_whale | |
| n02509815 7 lesser_panda | |
| n02124075 8 Egyptian_cat | |
| n02417914 9 ibex | |
| n02123394 10 Persian_cat |
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 ast | |
| import pandas as pd | |
| data = pd.read_csv('path_to_healthtap_file.csv') | |
| all_questions = [] | |
| all_answers = [] | |
| for question, answer_format in zip(data.question, data.answers): | |
| try: | |
| if answer_format != "[]": | |
| all_answers.append(ast.literal_eval(answer_format)[0]["answer"]) |