Skip to content

Commit

Permalink
WordCloud Work Experience Final
Browse files Browse the repository at this point in the history
Final Iteration from me.
  • Loading branch information
xHakanai authored Jul 28, 2020
1 parent 1c88dbd commit 06f26f1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,15 @@
relations_count = dict(Counter(relations_count))
stop_words = ['the', 'a', '<span', '', 'is', 'and', 'of', 'are', 'during', 'which', 'both', 'that', 'on', 'two', 'our', 'in', 'well', 'known', 'about', 'We', 'Show', 'Here', 'also', 'has', None]
abstract_list = []
abstract_dict
for i in abstract_dict['value'].split(' '):
for j in range(0,len(stop_words)):
if stop_words[j] == i:
pass
else:
abstract_list.append(i)

abstract_count = dict(Counter(abstract_list))
af = pd.DataFrame(abstract_list.items(), columns = ['Abstract','Count'])
abstract_count_dict = dict(Counter(abstract_list))
af = pd.DataFrame(abstract_count_dict.items(), columns = ['Abstract','Count'])
word2 = WordCloud(background_color="black", collocations=False).generate(text)
text = " ".join(Abstract for Abstract in af.Abstract)
plt.figure(figsize=(30,15))
Expand All @@ -113,6 +112,7 @@

df = pd.DataFrame(relationship_counter.items(), columns = ['Name','Count'])
updated_df = df[df['Name'].apply(lambda x: "PMID" not in x)]
stopwords=set(STOPWORDS)
stopwords.update(["Proteins", "Genes", "Relations", "Concepts", "PMID", "Protein"])
wordcloud = WordCloud(stopwords=stopwords, background_color="white").generate('text')
text = " ".join(name for name in updated_df.Name)
Expand Down
Binary file added word2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added wordcloud2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

1 comment on commit 06f26f1

@AjitPS
Copy link
Collaborator

@AjitPS AjitPS commented on 06f26f1 Jul 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great job, thanks Luke :)

Please sign in to comment.