faizhalas commited on
Commit
786ce47
·
verified ·
1 Parent(s): b00bae3

Update pages/3 Bidirected Network.py

Browse files
Files changed (1) hide show
  1. pages/3 Bidirected Network.py +9 -1
pages/3 Bidirected Network.py CHANGED
@@ -93,6 +93,9 @@ with st.expander("Before you start", expanded = True):
93
  | Dimensions | Comma-separated values | MeSH terms |
94
  | | (.csv) | |
95
  +----------------+------------------------+---------------------------------+
 
 
 
96
  | Other | .csv .xls .xlsx | Change your column to 'Keyword' |
97
  | | | and separate the words with ';' |
98
  +----------------+------------------------+---------------------------------+
@@ -133,6 +136,10 @@ def upload(extype):
133
  'Publication Type': 'Document Type'
134
  }
135
  papers.rename(columns=col_dict, inplace=True)
 
 
 
 
136
 
137
  return papers
138
 
@@ -154,13 +161,14 @@ def conv_txt(extype):
154
  'rights_date_used': 'Year'}
155
  uploaded_file.seek(0)
156
  papers = pd.read_csv(uploaded_file, sep='\t')
 
157
  if("htid" in papers.columns):
158
  papers = sf.htrc(papers)
159
  papers.rename(columns=col_dict, inplace=True)
160
  print(papers)
 
161
  return papers
162
 
163
-
164
  @st.cache_data(ttl=3600)
165
  def conv_json(extype):
166
  col_dict={'title': 'title',
 
93
  | Dimensions | Comma-separated values | MeSH terms |
94
  | | (.csv) | |
95
  +----------------+------------------------+---------------------------------+
96
+ | OpenAlex | Comma-separated values | Keywords |
97
+ | | (.csv) | |
98
+ +----------------+------------------------+---------------------------------+
99
  | Other | .csv .xls .xlsx | Change your column to 'Keyword' |
100
  | | | and separate the words with ';' |
101
  +----------------+------------------------+---------------------------------+
 
136
  'Publication Type': 'Document Type'
137
  }
138
  papers.rename(columns=col_dict, inplace=True)
139
+
140
+ elif "ids.openalex" in papers.columns:
141
+ papers.rename(columns={'keywords.display_name': 'Keywords'}, inplace=True)
142
+ papers["Keywords"] = papers["Keywords"].astype(str).str.replace("|", "; ")
143
 
144
  return papers
145
 
 
161
  'rights_date_used': 'Year'}
162
  uploaded_file.seek(0)
163
  papers = pd.read_csv(uploaded_file, sep='\t')
164
+
165
  if("htid" in papers.columns):
166
  papers = sf.htrc(papers)
167
  papers.rename(columns=col_dict, inplace=True)
168
  print(papers)
169
+
170
  return papers
171
 
 
172
  @st.cache_data(ttl=3600)
173
  def conv_json(extype):
174
  col_dict={'title': 'title',