earnings-calls-qa / utils /transcript_retrieval.py
awinml's picture
Upload 17 files (#7)
c88b2dc
raw
history blame contribute delete
569 Bytes
# Transcript Retrieval
def retrieve_transcript(data, year, quarter, ticker):
print(year, quarter, ticker)
row = data.loc[
(data.Year == int(year))
& (data.Quarter == quarter)
& (data.Ticker == ticker),
["File_Name"],
]
filename = row.iloc[0, 0]
print(filename)
# convert row to a string and join values with "-"
# row_str = "-".join(row.astype(str)) + ".txt"
open_file = open(
f"Transcripts/{ticker}/{filename}",
"r",
)
file_text = open_file.read()
return f"""{file_text}"""