Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +5 -0
src/streamlit_app.py
CHANGED
|
@@ -176,6 +176,7 @@ def process_works_to_author_profiles(works, topic_filter=None, journal_filter=No
|
|
| 176 |
'count': 0,
|
| 177 |
'citations': [],
|
| 178 |
'topics': Counter(),
|
|
|
|
| 179 |
'coauthors': Counter(),
|
| 180 |
'journals': Counter(),
|
| 181 |
'countries': Counter(),
|
|
@@ -193,6 +194,7 @@ def process_works_to_author_profiles(works, topic_filter=None, journal_filter=No
|
|
| 193 |
|
| 194 |
topic = work.get('primary_topic')
|
| 195 |
topic_name = topic.get('display_name', 'Unknown') if topic else 'Unknown'
|
|
|
|
| 196 |
|
| 197 |
# Apply filters
|
| 198 |
if topic_filter and topic_filter not in topic_name.lower():
|
|
@@ -240,6 +242,9 @@ def process_works_to_author_profiles(works, topic_filter=None, journal_filter=No
|
|
| 240 |
|
| 241 |
if topic_name != 'Unknown':
|
| 242 |
profile['topics'][topic_name] += 1
|
|
|
|
|
|
|
|
|
|
| 243 |
|
| 244 |
for other_auth in work.get('authorships', []):
|
| 245 |
other_name = other_auth.get('author', {}).get('display_name', '')
|
|
|
|
| 176 |
'count': 0,
|
| 177 |
'citations': [],
|
| 178 |
'topics': Counter(),
|
| 179 |
+
'topic_ids': {}, # Store topic IDs
|
| 180 |
'coauthors': Counter(),
|
| 181 |
'journals': Counter(),
|
| 182 |
'countries': Counter(),
|
|
|
|
| 194 |
|
| 195 |
topic = work.get('primary_topic')
|
| 196 |
topic_name = topic.get('display_name', 'Unknown') if topic else 'Unknown'
|
| 197 |
+
topic_id = topic.get('id', '') if topic else ''
|
| 198 |
|
| 199 |
# Apply filters
|
| 200 |
if topic_filter and topic_filter not in topic_name.lower():
|
|
|
|
| 242 |
|
| 243 |
if topic_name != 'Unknown':
|
| 244 |
profile['topics'][topic_name] += 1
|
| 245 |
+
# Store the topic ID for this topic name
|
| 246 |
+
if topic_name not in profile['topic_ids'] and topic_id:
|
| 247 |
+
profile['topic_ids'][topic_name] = topic_id
|
| 248 |
|
| 249 |
for other_auth in work.get('authorships', []):
|
| 250 |
other_name = other_auth.get('author', {}).get('display_name', '')
|