Array3022 commited on
Commit
f259e38
·
1 Parent(s): d62ad66

2024-02-16 Release

Browse files
Files changed (3) hide show
  1. .gitattributes +0 -1
  2. pages/05_Text_Analysis.py +9 -12
  3. requirements.txt +2 -2
.gitattributes CHANGED
@@ -1,3 +1,2 @@
1
  *.json filter=lfs diff=lfs merge=lfs -text
2
  *.pkl.bz2 filter=lfs diff=lfs merge=lfs -text
3
- *.mp4 filter=lfs diff=lfs merge=lfs -text
 
1
  *.json filter=lfs diff=lfs merge=lfs -text
2
  *.pkl.bz2 filter=lfs diff=lfs merge=lfs -text
 
pages/05_Text_Analysis.py CHANGED
@@ -82,12 +82,6 @@ def group_entity_by_year(data):
82
  return entitiesDict
83
 
84
  def group_journal_by_year(data):
85
- # records = []
86
- # for idx, row in data.iterrows():
87
- # year = row['DP']
88
- # journal_title = row['JT']
89
- # journal_id = row['JID']
90
- # records.append((year, journal_id, journal_title))
91
 
92
  records = zip(data['DP'], data['JID'], data['JT'])
93
  journalsDict = {} # {JID: [{DP: count}, total_count, JT]
@@ -594,11 +588,15 @@ if submit_collocation:
594
  st.pyplot(collocation_plot)
595
 
596
  elif submit_journal:
597
- st.subheader('Journal Frequency')
598
- st.markdown('The NLM lists the names of journals associated with these identifiers [here](https://ftp.ncbi.nih.gov/pubmed/J_Medline.txt).')
599
- st.pyplot(jid_frequency(year_start=year_start_journal, year_end=year_end_journal, n=n_journal))
600
- st.pyplot(jid_frequency_by_year(year_start=year_start_journal, year_end=year_end_journal, n=n_journal))
601
- st.divider()
 
 
 
 
602
 
603
  st.subheader('Place of Publication Frequency')
604
  st.markdown('Note that the place of publication is derived from the location of the journal, not the location of the author(s).')
@@ -609,7 +607,6 @@ elif submit_nbe:
609
  st.markdown('This program uses a natural language processing model to extract named biological entities from the abstracts in the database. The model categorizes these entities as either a disease or an anatomical term. This is an artifact of the corpus that trained the model.')
610
  st.pyplot(ner_frequency(n=n_nbe, entity_toggle=entity, year_start=year_start_nbe, year_end=year_end_nbe))
611
  st.pyplot(ner_frequency_by_year(n=n_nbe, entity_toggle=entity, year_start=year_start_nbe, year_end=year_end_nbe))
612
- # st.pyplot(run_colocation('cancer'))
613
 
614
  elif submit_mesh:
615
  st.header('MeSH Term Data')
 
82
  return entitiesDict
83
 
84
  def group_journal_by_year(data):
 
 
 
 
 
 
85
 
86
  records = zip(data['DP'], data['JID'], data['JT'])
87
  journalsDict = {} # {JID: [{DP: count}, total_count, JT]
 
588
  st.pyplot(collocation_plot)
589
 
590
  elif submit_journal:
591
+ '''
592
+ Eliminated JID metrics for now because JID is not actually a unique identifier for journals, despite claims to the contrary (https://www.nlm.nih.gov/bsd/mms/medlineelements.html#jid).
593
+ Did something go wrong in the data collection/cleaning process?
594
+ '''
595
+ # st.subheader('Journal Frequency')
596
+ # st.markdown('The NLM lists the names of journals associated with these identifiers [here](https://ftp.ncbi.nih.gov/pubmed/J_Medline.txt).')
597
+ # st.pyplot(jid_frequency(year_start=year_start_journal, year_end=year_end_journal, n=n_journal))
598
+ # st.pyplot(jid_frequency_by_year(year_start=year_start_journal, year_end=year_end_journal, n=n_journal))
599
+ # st.divider()
600
 
601
  st.subheader('Place of Publication Frequency')
602
  st.markdown('Note that the place of publication is derived from the location of the journal, not the location of the author(s).')
 
607
  st.markdown('This program uses a natural language processing model to extract named biological entities from the abstracts in the database. The model categorizes these entities as either a disease or an anatomical term. This is an artifact of the corpus that trained the model.')
608
  st.pyplot(ner_frequency(n=n_nbe, entity_toggle=entity, year_start=year_start_nbe, year_end=year_end_nbe))
609
  st.pyplot(ner_frequency_by_year(n=n_nbe, entity_toggle=entity, year_start=year_start_nbe, year_end=year_end_nbe))
 
610
 
611
  elif submit_mesh:
612
  st.header('MeSH Term Data')
requirements.txt CHANGED
@@ -3,5 +3,5 @@ pandas==2.1.0
3
  matplotlib==3.7.2
4
  top2vec[indexing]==1.0.34
5
  wordcloud==1.9.2
6
- stanza==1.5.0 # Stanza is only used for a small bit of text processing on user input, but it pulls in alot of additonal dependencies. It could be replaced with a lighter library or removed entirely.
7
- numpy==1.24.3
 
3
  matplotlib==3.7.2
4
  top2vec[indexing]==1.0.34
5
  wordcloud==1.9.2
6
+ stanza==1.5.0 # Stanza is only used for a small bit of text processing on user input, but it pulls in a lot of additional dependencies. It could be replaced with a lighter library or removed entirely.
7
+ numpy==1.24.3