verification

This commit is contained in:
Alejandro Moreo Fernandez 2019-06-06 11:13:04 +02:00
parent 436550cf91
commit 56770446bd
1 changed files with 4 additions and 1 deletions

View File

@ -25,13 +25,16 @@ for epistola in [1]:
if epistola==2:
paragraphs = range(14, 91)
target = [f'EpistolaXIII_{epistola}_{paragraph}.txt' for paragraph in paragraphs]
target = [f'EpistolaXIII_{epistola}.txt'] + [f'EpistolaXIII_{epistola}_{paragraph}.txt' for paragraph in paragraphs]
positive, negative, ep_texts = load_texts(path, positive_author='Dante', unknown_target=target)
pickle_file = f'../dante_color/epistola{epistola}.pkl'
if os.path.exists(pickle_file):
print(f'loading pickle file {pickle_file}')
probabilities = pickle.load(open(pickle_file, 'rb'))
for prob,text in zip(probabilities,ep_texts):
text = text.replace('\n','')
print(f"{prob:.3f}:{text}")
else:
print(f'generating pickle file')
n_full_docs = len(positive) + len(negative)