Created
November 26, 2019 18:33
-
-
Save rafaljanwojcik/9add154cb42b2450d68134a7150de65c to your computer and use it in GitHub Desktop.
This file contains 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
replacement_df = pd.DataFrame(data=[replaced_closeness_scores, replaced_tfidf_scores, file_weighting.title, file_weighting.rate]).T | |
replacement_df.columns = ['sentiment_coeff', 'tfidf_scores', 'sentence', 'sentiment'] | |
replacement_df['sentiment_rate'] = replacement_df.apply(lambda x: np.array(x.loc['sentiment_coeff']) @ np.array(x.loc['tfidf_scores']), axis=1) | |
replacement_df['prediction'] = (replacement_df.sentiment_rate>0).astype('int8') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment