In [257]:
from generate_samples import load_rnn_samples, load_human_samples
In [258]:
rnn_poems = load_rnn_samples()
In [259]:
human_poems = load_human_samples()
In [273]:
from evaluate import eval_poems
from rhyme import RhymeEvaluator
import pandas as pd
%matplotlib inline
%autoreload 2
%reload_ext autoreload
In [274]:
evaluator = RhymeEvaluator()
In [263]:
rnn_scores, rnn_mean, rnn_std = eval_poems(evaluator, rnn_poems)
In [264]:
human_scores, human_mean, human_std = eval_poems(evaluator, human_poems)
In [284]:
rnn_df = pd.DataFrame(rnn_scores, columns=['Combined Score'])
In [334]:
ax = rnn_df.plot(kind='hist', bins=100, figsize=(10, 10), legend=False, fontsize=14)
ax.set_xlabel('Combined Score', fontsize=20)
ax.set_ylabel('Frequency', fontsize=20)
ax.set_title('Score Distribution for Generated Sample', fontsize=24)
Out[334]:
In [309]:
human_df = pd.DataFrame(human_scores, columns=['Combined Score'])
In [335]:
ax = human_df.plot(kind='hist', bins=100, figsize=(10, 10), legend=False, fontsize=14)
ax.set_xlabel('Combined Score', fontsize=20)
ax.set_ylabel('Frequency', fontsize=20)
ax.set_title('Score Distribution for Training Data Sample', fontsize=24)
Out[335]:
In [265]:
poem = human_poems[0]
poem
Out[265]:
In [275]:
evaluator.rhyme_util.get_poem_tone_types(poem)
Out[275]:
In [246]:
(max_combined, max_tone, max_rhyme), scores = evaluator.eval(poem, output_all_scores=True, output_split=True)
In [249]:
(max_combined, max_tone, max_rhyme)
Out[249]:
In [251]:
scores
Out[251]: