verification
This commit is contained in:
parent
436550cf91
commit
56770446bd
|
|
@ -25,13 +25,16 @@ for epistola in [1]:
|
||||||
if epistola==2:
|
if epistola==2:
|
||||||
paragraphs = range(14, 91)
|
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)
|
positive, negative, ep_texts = load_texts(path, positive_author='Dante', unknown_target=target)
|
||||||
|
|
||||||
pickle_file = f'../dante_color/epistola{epistola}.pkl'
|
pickle_file = f'../dante_color/epistola{epistola}.pkl'
|
||||||
if os.path.exists(pickle_file):
|
if os.path.exists(pickle_file):
|
||||||
print(f'loading pickle file {pickle_file}')
|
print(f'loading pickle file {pickle_file}')
|
||||||
probabilities = pickle.load(open(pickle_file, 'rb'))
|
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:
|
else:
|
||||||
print(f'generating pickle file')
|
print(f'generating pickle file')
|
||||||
n_full_docs = len(positive) + len(negative)
|
n_full_docs = len(positive) + len(negative)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue