citation-map 4.0__tar.gz → 4.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {citation-map-4.0 → citation-map-4.2}/PKG-INFO +23 -12
- {citation-map-4.0 → citation-map-4.2}/README.md +22 -11
- {citation-map-4.0 → citation-map-4.2}/citation_map/citation_map.py +36 -37
- {citation-map-4.0 → citation-map-4.2}/citation_map.egg-info/PKG-INFO +23 -12
- {citation-map-4.0 → citation-map-4.2}/setup.py +1 -1
- {citation-map-4.0 → citation-map-4.2}/LICENSE.md +0 -0
- {citation-map-4.0 → citation-map-4.2}/citation_map/__init__.py +0 -0
- {citation-map-4.0 → citation-map-4.2}/citation_map/scholarly_support.py +0 -0
- {citation-map-4.0 → citation-map-4.2}/citation_map.egg-info/SOURCES.txt +0 -0
- {citation-map-4.0 → citation-map-4.2}/citation_map.egg-info/dependency_links.txt +0 -0
- {citation-map-4.0 → citation-map-4.2}/citation_map.egg-info/requires.txt +0 -0
- {citation-map-4.0 → citation-map-4.2}/citation_map.egg-info/top_level.txt +0 -0
- {citation-map-4.0 → citation-map-4.2}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: citation-map
|
|
3
|
-
Version: 4.
|
|
3
|
+
Version: 4.2
|
|
4
4
|
Summary: A simple tool to generate your Google Scholar citation world map.
|
|
5
5
|
Home-page: https://github.com/ChenLiu-1996/CitationMap
|
|
6
6
|
Author: Chen Liu
|
|
@@ -35,7 +35,7 @@ Research areas: Machine Learning, Spatial-Temporal Modeling, Medical Vision, AI4
|
|
|
35
35
|
**[Asking for advice]**
|
|
36
36
|
1. This is my first time dealing with webscraping/crawling. Users have reported stability issues, and I suspect the major problems are (1) being caught by CAPTCHA or robot check, and (2) being flagged for blacklist by Google Scholar. If you are experienced in these areas and have good advice, I would highly appreciate a GitHub issue or a pull request.
|
|
37
37
|
|
|
38
|
-
[Aug 2, 2024] Version 4.0 released >>> Logic update. A new input argument `affiliation_conservative`. If
|
|
38
|
+
[Aug 2, 2024] Version 4.0 released >>> Logic update. A new input argument `affiliation_conservative`. If set to True, we will use **a very conservative approach to identify affiliations** which leads to **much higher precision and lower recall**. Many thanks to [Zhijian Liu](https://github.com/zhijian-liu) for the [helpful discussion](https://github.com/ChenLiu-1996/CitationMap/issues/8).
|
|
39
39
|
|
|
40
40
|
[Jul 28, 2024] Version 3.10 released >>> Logic update. Tested on a professor's profile **with 10,000 citations**!
|
|
41
41
|
|
|
@@ -55,13 +55,13 @@ You will be given an **HTML file** as the output of the script.
|
|
|
55
55
|
|
|
56
56
|
If you open it on a browser, you will see your own version of the following citation world map.
|
|
57
57
|
|
|
58
|
+
<img src = "assets/citation_world_map.png" width=800>
|
|
59
|
+
|
|
58
60
|
Besides, there will be a **CSV file** recording citation information (citing author, citing paper, cited paper, affiliation, detailed location).
|
|
59
61
|
|
|
60
62
|
**Disclaimer:** It is reasonable for this tool to make some minor mistakes: missing a few citing authors, dropping a couple of pins in wrong locations, etc. If you care a lot about ensuring all citing authors' affiliations are included and accurately marked, you could try manually annotating on [Google My Maps](https://www.google.com/maps/d/) instead. This tool is meant to help people who cannot tolerate this painful process, especailly when they have a decent number of citations.
|
|
61
63
|
|
|
62
|
-
**NOTE:** **Now you can trade off between affiliation precision and recall**
|
|
63
|
-
|
|
64
|
-
<img src = "assets/citation_world_map.png" width=800>
|
|
64
|
+
**NOTE:** **Now you can trade off between affiliation precision and recall** with the `affiliation_conservative` option. If set to True, we will use the Google Scholar verified official organization name from the citing authors. This is a very conservative approach, since (1) the author needs to self-report it in the affiliation panel, (2) the author needs to verify with the matching email address, and (3) the organization needs to be recorded by Google Scholar. For example, Meta (the company) is not in the list. Many thanks to [Zhijian Liu](https://github.com/zhijian-liu) for the [helpful discussion](https://github.com/ChenLiu-1996/CitationMap/issues/8).
|
|
65
65
|
|
|
66
66
|
|
|
67
67
|
## User Guide
|
|
@@ -90,6 +90,8 @@ Besides, there will be a **CSV file** recording citation information (citing aut
|
|
|
90
90
|
generate_citation_map(scholar_id)
|
|
91
91
|
```
|
|
92
92
|
|
|
93
|
+
Note that in Version 4.0, we will cache the results before identifying affiliations. So if you want to rerun the same author from scratch, you need to delete the cache (default location is 'cache').
|
|
94
|
+
|
|
93
95
|
More input arguments are shown in [the demo script](https://github.com/ChenLiu-1996/CitationMap/blob/main/demo/demo.py).
|
|
94
96
|
|
|
95
97
|
You can take a look at the input arguments (listed below) of the function `generate_citation_map` in case you need those functionalities.
|
|
@@ -107,13 +109,13 @@ Besides, there will be a **CSV file** recording citation information (citing aut
|
|
|
107
109
|
The path to the output csv file.
|
|
108
110
|
cache_folder: str
|
|
109
111
|
(default is 'cache')
|
|
110
|
-
The folder to save intermediate results,
|
|
111
|
-
after finding (author, paper) but before finding the affiliations.
|
|
112
|
+
The folder to save intermediate results, after finding (author, paper) but before finding the affiliations.
|
|
112
113
|
This is because the user might want to try the aggressive vs. conservative approach.
|
|
114
|
+
Set to None if you do not want caching.
|
|
113
115
|
affiliation_conservative: bool
|
|
114
116
|
(default is False)
|
|
115
|
-
If true, we will use a more conservative approach
|
|
116
|
-
If false, we will use a more aggressive approach
|
|
117
|
+
If true, we will use a more conservative approach to identify affiliations.
|
|
118
|
+
If false, we will use a more aggressive approach to identify affiliations.
|
|
117
119
|
num_processes: int
|
|
118
120
|
(default is 16)
|
|
119
121
|
Number of processes for parallel processing.
|
|
@@ -148,9 +150,9 @@ Besides, there will be a **CSV file** recording citation information (citing aut
|
|
|
148
150
|
|
|
149
151
|
## Debug
|
|
150
152
|
|
|
151
|
-
1. `MaxTriesExceededException` or (`[WARNING!] Blocked by CAPTCHA or robot check` for all entries).
|
|
153
|
+
1. `MaxTriesExceededException` or `Exception: Failed to fetch the Google Scholar page` or (`[WARNING!] Blocked by CAPTCHA or robot check` for all entries).
|
|
152
154
|
|
|
153
|
-
- From my experience,
|
|
155
|
+
- From my experience, these are good indicators that your IP address is blocked by Google Scholar due to excessive crawling (using the `scholarly` package).
|
|
154
156
|
- One hot fix I found was to hop on a University VPN and run again. I typically experience this error after running the tool twice, and I need to disconnect and reconnect my VPN to "unblock" myself.
|
|
155
157
|
- In case this does not help, you can try to change IP adress and reduce the number of processes (e.g., setting `num_processes=1`).
|
|
156
158
|
- If you get `[WARNING!] Blocked by CAPTCHA or robot check` no more than several times, it's not a big deal especially if you have many citing authors.
|
|
@@ -174,7 +176,16 @@ Besides, there will be a **CSV file** recording citation information (citing aut
|
|
|
174
176
|
```
|
|
175
177
|
|
|
176
178
|
## Changelog
|
|
177
|
-
|
|
179
|
+
<details>
|
|
180
|
+
<summary>Version 4.0 (Aug 2, 2024)</summary>
|
|
181
|
+
<br>
|
|
182
|
+
|
|
183
|
+
1. **Now you can trade off between precision and recall as we identify the affiliations.**
|
|
184
|
+
2. Added caching before identifying the affiliations, since users might want to try both the conservative and aggressive approaches.
|
|
185
|
+
3. Slight optimization in the affiliation to geocode stage by adding early breaking if successful.
|
|
186
|
+
|
|
187
|
+
</details>
|
|
188
|
+
|
|
178
189
|
|
|
179
190
|
<details>
|
|
180
191
|
<summary>Version 3.11 (Jul 28, 2024)</summary>
|
|
@@ -19,7 +19,7 @@ Research areas: Machine Learning, Spatial-Temporal Modeling, Medical Vision, AI4
|
|
|
19
19
|
**[Asking for advice]**
|
|
20
20
|
1. This is my first time dealing with webscraping/crawling. Users have reported stability issues, and I suspect the major problems are (1) being caught by CAPTCHA or robot check, and (2) being flagged for blacklist by Google Scholar. If you are experienced in these areas and have good advice, I would highly appreciate a GitHub issue or a pull request.
|
|
21
21
|
|
|
22
|
-
[Aug 2, 2024] Version 4.0 released >>> Logic update. A new input argument `affiliation_conservative`. If
|
|
22
|
+
[Aug 2, 2024] Version 4.0 released >>> Logic update. A new input argument `affiliation_conservative`. If set to True, we will use **a very conservative approach to identify affiliations** which leads to **much higher precision and lower recall**. Many thanks to [Zhijian Liu](https://github.com/zhijian-liu) for the [helpful discussion](https://github.com/ChenLiu-1996/CitationMap/issues/8).
|
|
23
23
|
|
|
24
24
|
[Jul 28, 2024] Version 3.10 released >>> Logic update. Tested on a professor's profile **with 10,000 citations**!
|
|
25
25
|
|
|
@@ -39,13 +39,13 @@ You will be given an **HTML file** as the output of the script.
|
|
|
39
39
|
|
|
40
40
|
If you open it on a browser, you will see your own version of the following citation world map.
|
|
41
41
|
|
|
42
|
+
<img src = "assets/citation_world_map.png" width=800>
|
|
43
|
+
|
|
42
44
|
Besides, there will be a **CSV file** recording citation information (citing author, citing paper, cited paper, affiliation, detailed location).
|
|
43
45
|
|
|
44
46
|
**Disclaimer:** It is reasonable for this tool to make some minor mistakes: missing a few citing authors, dropping a couple of pins in wrong locations, etc. If you care a lot about ensuring all citing authors' affiliations are included and accurately marked, you could try manually annotating on [Google My Maps](https://www.google.com/maps/d/) instead. This tool is meant to help people who cannot tolerate this painful process, especailly when they have a decent number of citations.
|
|
45
47
|
|
|
46
|
-
**NOTE:** **Now you can trade off between affiliation precision and recall**
|
|
47
|
-
|
|
48
|
-
<img src = "assets/citation_world_map.png" width=800>
|
|
48
|
+
**NOTE:** **Now you can trade off between affiliation precision and recall** with the `affiliation_conservative` option. If set to True, we will use the Google Scholar verified official organization name from the citing authors. This is a very conservative approach, since (1) the author needs to self-report it in the affiliation panel, (2) the author needs to verify with the matching email address, and (3) the organization needs to be recorded by Google Scholar. For example, Meta (the company) is not in the list. Many thanks to [Zhijian Liu](https://github.com/zhijian-liu) for the [helpful discussion](https://github.com/ChenLiu-1996/CitationMap/issues/8).
|
|
49
49
|
|
|
50
50
|
|
|
51
51
|
## User Guide
|
|
@@ -74,6 +74,8 @@ Besides, there will be a **CSV file** recording citation information (citing aut
|
|
|
74
74
|
generate_citation_map(scholar_id)
|
|
75
75
|
```
|
|
76
76
|
|
|
77
|
+
Note that in Version 4.0, we will cache the results before identifying affiliations. So if you want to rerun the same author from scratch, you need to delete the cache (default location is 'cache').
|
|
78
|
+
|
|
77
79
|
More input arguments are shown in [the demo script](https://github.com/ChenLiu-1996/CitationMap/blob/main/demo/demo.py).
|
|
78
80
|
|
|
79
81
|
You can take a look at the input arguments (listed below) of the function `generate_citation_map` in case you need those functionalities.
|
|
@@ -91,13 +93,13 @@ Besides, there will be a **CSV file** recording citation information (citing aut
|
|
|
91
93
|
The path to the output csv file.
|
|
92
94
|
cache_folder: str
|
|
93
95
|
(default is 'cache')
|
|
94
|
-
The folder to save intermediate results,
|
|
95
|
-
after finding (author, paper) but before finding the affiliations.
|
|
96
|
+
The folder to save intermediate results, after finding (author, paper) but before finding the affiliations.
|
|
96
97
|
This is because the user might want to try the aggressive vs. conservative approach.
|
|
98
|
+
Set to None if you do not want caching.
|
|
97
99
|
affiliation_conservative: bool
|
|
98
100
|
(default is False)
|
|
99
|
-
If true, we will use a more conservative approach
|
|
100
|
-
If false, we will use a more aggressive approach
|
|
101
|
+
If true, we will use a more conservative approach to identify affiliations.
|
|
102
|
+
If false, we will use a more aggressive approach to identify affiliations.
|
|
101
103
|
num_processes: int
|
|
102
104
|
(default is 16)
|
|
103
105
|
Number of processes for parallel processing.
|
|
@@ -132,9 +134,9 @@ Besides, there will be a **CSV file** recording citation information (citing aut
|
|
|
132
134
|
|
|
133
135
|
## Debug
|
|
134
136
|
|
|
135
|
-
1. `MaxTriesExceededException` or (`[WARNING!] Blocked by CAPTCHA or robot check` for all entries).
|
|
137
|
+
1. `MaxTriesExceededException` or `Exception: Failed to fetch the Google Scholar page` or (`[WARNING!] Blocked by CAPTCHA or robot check` for all entries).
|
|
136
138
|
|
|
137
|
-
- From my experience,
|
|
139
|
+
- From my experience, these are good indicators that your IP address is blocked by Google Scholar due to excessive crawling (using the `scholarly` package).
|
|
138
140
|
- One hot fix I found was to hop on a University VPN and run again. I typically experience this error after running the tool twice, and I need to disconnect and reconnect my VPN to "unblock" myself.
|
|
139
141
|
- In case this does not help, you can try to change IP adress and reduce the number of processes (e.g., setting `num_processes=1`).
|
|
140
142
|
- If you get `[WARNING!] Blocked by CAPTCHA or robot check` no more than several times, it's not a big deal especially if you have many citing authors.
|
|
@@ -158,7 +160,16 @@ Besides, there will be a **CSV file** recording citation information (citing aut
|
|
|
158
160
|
```
|
|
159
161
|
|
|
160
162
|
## Changelog
|
|
161
|
-
|
|
163
|
+
<details>
|
|
164
|
+
<summary>Version 4.0 (Aug 2, 2024)</summary>
|
|
165
|
+
<br>
|
|
166
|
+
|
|
167
|
+
1. **Now you can trade off between precision and recall as we identify the affiliations.**
|
|
168
|
+
2. Added caching before identifying the affiliations, since users might want to try both the conservative and aggressive approaches.
|
|
169
|
+
3. Slight optimization in the affiliation to geocode stage by adding early breaking if successful.
|
|
170
|
+
|
|
171
|
+
</details>
|
|
172
|
+
|
|
162
173
|
|
|
163
174
|
<details>
|
|
164
175
|
<summary>Version 3.11 (Jul 28, 2024)</summary>
|
|
@@ -19,18 +19,16 @@ from typing import Any, Iterable, List, Tuple
|
|
|
19
19
|
from .scholarly_support import get_citing_author_ids_and_citing_papers, get_organization_name
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
def
|
|
22
|
+
def find_all_citing_authors(scholar_id: str, num_processes: int = 16) -> List[Tuple[str]]:
|
|
23
23
|
'''
|
|
24
|
-
Step 1
|
|
24
|
+
Step 1. Find all citing authors.
|
|
25
25
|
'''
|
|
26
|
+
# Find Google Scholar Profile using Scholar ID.
|
|
26
27
|
author = scholarly.search_author_id(scholar_id)
|
|
27
28
|
author = scholarly.fill(author, sections=['publications'])
|
|
28
|
-
|
|
29
|
+
publications = author['publications']
|
|
30
|
+
print('Author profile found, with %d publications.\n' % len(publications))
|
|
29
31
|
|
|
30
|
-
def find_all_citing_authors(publications: Iterable, num_processes: int = 16) -> List[Tuple[str]]:
|
|
31
|
-
'''
|
|
32
|
-
Step 2. Find all citing authors.
|
|
33
|
-
'''
|
|
34
32
|
# Fetch metadata for all publications.
|
|
35
33
|
if num_processes > 1 and isinstance(num_processes, int):
|
|
36
34
|
with Pool(processes=num_processes) as pool:
|
|
@@ -72,7 +70,7 @@ def find_all_citing_affiliations(all_citing_author_paper_tuple_list: List[Tuple[
|
|
|
72
70
|
num_processes: int = 16,
|
|
73
71
|
affiliation_conservative: bool = False):
|
|
74
72
|
'''
|
|
75
|
-
Step
|
|
73
|
+
Step 2. Find all citing affiliations.
|
|
76
74
|
'''
|
|
77
75
|
if affiliation_conservative:
|
|
78
76
|
__affiliations_from_authors = __affiliations_from_authors_conservative
|
|
@@ -98,7 +96,7 @@ def find_all_citing_affiliations(all_citing_author_paper_tuple_list: List[Tuple[
|
|
|
98
96
|
|
|
99
97
|
def clean_affiliation_names(author_paper_affiliation_tuple_list: List[Tuple[str]]) -> List[Tuple[str]]:
|
|
100
98
|
'''
|
|
101
|
-
Step
|
|
99
|
+
Step 3 (Optional). Clean up the names of affiliations from the authors' affiliation tab on their Google Scholar profiles.
|
|
102
100
|
NOTE: This logic is very naive. Please send an issue or pull request if you have any idea how to improve it.
|
|
103
101
|
Currently we will not consider any paid service or tools that pose extra burden on the users, such as GPT API.
|
|
104
102
|
'''
|
|
@@ -125,7 +123,7 @@ def clean_affiliation_names(author_paper_affiliation_tuple_list: List[Tuple[str]
|
|
|
125
123
|
|
|
126
124
|
def affiliation_text_to_geocode(author_paper_affiliation_tuple_list: List[Tuple[str]], max_attempts: int = 3) -> List[Tuple[str]]:
|
|
127
125
|
'''
|
|
128
|
-
Step
|
|
126
|
+
Step 4: Convert affiliations in plain text to Geocode.
|
|
129
127
|
'''
|
|
130
128
|
coordinates_and_info = []
|
|
131
129
|
# NOTE: According to the Nomatim Usage Policy (https://operations.osmfoundation.org/policies/nominatim/),
|
|
@@ -181,7 +179,7 @@ def affiliation_text_to_geocode(author_paper_affiliation_tuple_list: List[Tuple[
|
|
|
181
179
|
|
|
182
180
|
def create_map(coordinates_and_info: List[Tuple[str]], pin_colorful: bool = True):
|
|
183
181
|
'''
|
|
184
|
-
Step
|
|
182
|
+
Step 5.1: Create the Citation World Map.
|
|
185
183
|
|
|
186
184
|
For authors under the same affiliations, they will be displayed in the same pin.
|
|
187
185
|
'''
|
|
@@ -221,7 +219,7 @@ def create_map(coordinates_and_info: List[Tuple[str]], pin_colorful: bool = True
|
|
|
221
219
|
|
|
222
220
|
def export_csv(coordinates_and_info: List[Tuple[str]], csv_output_path: str) -> None:
|
|
223
221
|
'''
|
|
224
|
-
Step
|
|
222
|
+
Step 5.2: Export csv file recording citation information.
|
|
225
223
|
'''
|
|
226
224
|
|
|
227
225
|
citation_df = pd.DataFrame(coordinates_and_info,
|
|
@@ -351,13 +349,13 @@ def generate_citation_map(scholar_id: str,
|
|
|
351
349
|
The path to the output csv file.
|
|
352
350
|
cache_folder: str
|
|
353
351
|
(default is 'cache')
|
|
354
|
-
The folder to save intermediate results,
|
|
355
|
-
after finding (author, paper) but before finding the affiliations.
|
|
352
|
+
The folder to save intermediate results, after finding (author, paper) but before finding the affiliations.
|
|
356
353
|
This is because the user might want to try the aggressive vs. conservative approach.
|
|
354
|
+
Set to None if you do not want caching.
|
|
357
355
|
affiliation_conservative: bool
|
|
358
356
|
(default is False)
|
|
359
|
-
If true, we will use a more conservative approach
|
|
360
|
-
If false, we will use a more aggressive approach
|
|
357
|
+
If true, we will use a more conservative approach to identify affiliations.
|
|
358
|
+
If false, we will use a more aggressive approach to identify affiliations.
|
|
361
359
|
num_processes: int
|
|
362
360
|
(default is 16)
|
|
363
361
|
Number of processes for parallel processing.
|
|
@@ -380,30 +378,31 @@ def generate_citation_map(scholar_id: str,
|
|
|
380
378
|
scholarly.use_proxy(pg)
|
|
381
379
|
print('Using proxy.')
|
|
382
380
|
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
381
|
+
if cache_folder is not None:
|
|
382
|
+
cache_path = os.path.join(cache_folder, scholar_id, 'all_citing_author_paper_tuple_list.pkl')
|
|
383
|
+
else:
|
|
384
|
+
cache_path = None
|
|
386
385
|
|
|
387
|
-
|
|
388
|
-
|
|
386
|
+
if cache_path is None or not os.path.exists(cache_path):
|
|
387
|
+
print('No cache found for this author. Running from scratch.\n')
|
|
389
388
|
|
|
390
|
-
# NOTE: Step
|
|
391
|
-
|
|
392
|
-
all_citing_author_paper_tuple_list = find_all_citing_authors(author_profile['publications'],
|
|
389
|
+
# NOTE: Step 1. Find all citing authors.
|
|
390
|
+
all_citing_author_paper_tuple_list = find_all_citing_authors(scholar_id=scholar_id,
|
|
393
391
|
num_processes=num_processes)
|
|
394
|
-
print('
|
|
395
|
-
|
|
396
|
-
|
|
392
|
+
print('A total of %d citing authors recorded.\n' % len(all_citing_author_paper_tuple_list))
|
|
393
|
+
if cache_path is not None and len(all_citing_author_paper_tuple_list) > 0:
|
|
394
|
+
save_cache(all_citing_author_paper_tuple_list, cache_path)
|
|
395
|
+
print('Saved to cache: %s.\n' % cache_path)
|
|
397
396
|
|
|
398
397
|
else:
|
|
399
398
|
print('Cache found. Loading author paper affiliation information from cache.\n')
|
|
400
399
|
|
|
401
|
-
# NOTE: Step 1
|
|
400
|
+
# NOTE: Step 1. Load all citing authors.
|
|
402
401
|
all_citing_author_paper_tuple_list = load_cache(cache_path)
|
|
403
|
-
print('Loaded from cache: %s
|
|
404
|
-
print('
|
|
402
|
+
print('Loaded from cache: %s.\n' % cache_path)
|
|
403
|
+
print('A total of %d citing authors loaded.\n' % len(all_citing_author_paper_tuple_list))
|
|
405
404
|
|
|
406
|
-
# NOTE: Step
|
|
405
|
+
# NOTE: Step 2. Find all citing affiliations.
|
|
407
406
|
print('Identifying affiliations using the %s approach.' % ('conservative' if affiliation_conservative else 'aggressive'))
|
|
408
407
|
author_paper_affiliation_tuple_list = find_all_citing_affiliations(all_citing_author_paper_tuple_list,
|
|
409
408
|
num_processes=num_processes,
|
|
@@ -412,36 +411,36 @@ def generate_citation_map(scholar_id: str,
|
|
|
412
411
|
# Take unique tuples.
|
|
413
412
|
author_paper_affiliation_tuple_list = list(set(author_paper_affiliation_tuple_list))
|
|
414
413
|
|
|
415
|
-
# NOTE: Step
|
|
414
|
+
# NOTE: Step 3. Clean the affiliation strings (optional, only used if taking the aggressive approach).
|
|
416
415
|
if print_citing_affiliations:
|
|
417
416
|
if affiliation_conservative:
|
|
418
417
|
print('Taking the conservative approach. Will not need to clean the affiliation names.')
|
|
419
418
|
print('List of all citing authors and affiliations:\n')
|
|
420
419
|
else:
|
|
421
|
-
print('
|
|
420
|
+
print('Taking the aggressive approach. Cleaning the affiliation names.')
|
|
422
421
|
print('List of all citing authors and affiliations before cleaning:\n')
|
|
423
422
|
__print_author_and_affiliation(author_paper_affiliation_tuple_list)
|
|
424
423
|
if not affiliation_conservative:
|
|
425
424
|
cleaned_author_paper_affiliation_tuple_list = clean_affiliation_names(author_paper_affiliation_tuple_list)
|
|
426
425
|
if print_citing_affiliations:
|
|
427
|
-
print('
|
|
426
|
+
print('List of all citing authors and affiliations after cleaning:\n')
|
|
428
427
|
__print_author_and_affiliation(cleaned_author_paper_affiliation_tuple_list)
|
|
429
428
|
# Use the merged set to maximize coverage.
|
|
430
429
|
author_paper_affiliation_tuple_list += cleaned_author_paper_affiliation_tuple_list
|
|
431
430
|
# Take unique tuples.
|
|
432
431
|
author_paper_affiliation_tuple_list = list(set(author_paper_affiliation_tuple_list))
|
|
433
432
|
|
|
434
|
-
# NOTE: Step
|
|
433
|
+
# NOTE: Step 4. Convert affiliations in plain text to Geocode.
|
|
435
434
|
coordinates_and_info = affiliation_text_to_geocode(author_paper_affiliation_tuple_list)
|
|
436
435
|
# Take unique tuples.
|
|
437
436
|
coordinates_and_info = list(set(coordinates_and_info))
|
|
438
437
|
|
|
439
|
-
# NOTE: Step
|
|
438
|
+
# NOTE: Step 5.1. Create the citation world map.
|
|
440
439
|
citation_map = create_map(coordinates_and_info, pin_colorful=pin_colorful)
|
|
441
440
|
citation_map.save(output_path)
|
|
442
441
|
print('\nMap created and saved at %s.\n' % output_path)
|
|
443
442
|
|
|
444
|
-
# NOTE: Step
|
|
443
|
+
# NOTE: Step 5.2. Export csv file recording citation information.
|
|
445
444
|
export_csv(coordinates_and_info, csv_output_path)
|
|
446
445
|
print('\nCitation information exported to %s.' % csv_output_path)
|
|
447
446
|
return
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: citation-map
|
|
3
|
-
Version: 4.
|
|
3
|
+
Version: 4.2
|
|
4
4
|
Summary: A simple tool to generate your Google Scholar citation world map.
|
|
5
5
|
Home-page: https://github.com/ChenLiu-1996/CitationMap
|
|
6
6
|
Author: Chen Liu
|
|
@@ -35,7 +35,7 @@ Research areas: Machine Learning, Spatial-Temporal Modeling, Medical Vision, AI4
|
|
|
35
35
|
**[Asking for advice]**
|
|
36
36
|
1. This is my first time dealing with webscraping/crawling. Users have reported stability issues, and I suspect the major problems are (1) being caught by CAPTCHA or robot check, and (2) being flagged for blacklist by Google Scholar. If you are experienced in these areas and have good advice, I would highly appreciate a GitHub issue or a pull request.
|
|
37
37
|
|
|
38
|
-
[Aug 2, 2024] Version 4.0 released >>> Logic update. A new input argument `affiliation_conservative`. If
|
|
38
|
+
[Aug 2, 2024] Version 4.0 released >>> Logic update. A new input argument `affiliation_conservative`. If set to True, we will use **a very conservative approach to identify affiliations** which leads to **much higher precision and lower recall**. Many thanks to [Zhijian Liu](https://github.com/zhijian-liu) for the [helpful discussion](https://github.com/ChenLiu-1996/CitationMap/issues/8).
|
|
39
39
|
|
|
40
40
|
[Jul 28, 2024] Version 3.10 released >>> Logic update. Tested on a professor's profile **with 10,000 citations**!
|
|
41
41
|
|
|
@@ -55,13 +55,13 @@ You will be given an **HTML file** as the output of the script.
|
|
|
55
55
|
|
|
56
56
|
If you open it on a browser, you will see your own version of the following citation world map.
|
|
57
57
|
|
|
58
|
+
<img src = "assets/citation_world_map.png" width=800>
|
|
59
|
+
|
|
58
60
|
Besides, there will be a **CSV file** recording citation information (citing author, citing paper, cited paper, affiliation, detailed location).
|
|
59
61
|
|
|
60
62
|
**Disclaimer:** It is reasonable for this tool to make some minor mistakes: missing a few citing authors, dropping a couple of pins in wrong locations, etc. If you care a lot about ensuring all citing authors' affiliations are included and accurately marked, you could try manually annotating on [Google My Maps](https://www.google.com/maps/d/) instead. This tool is meant to help people who cannot tolerate this painful process, especailly when they have a decent number of citations.
|
|
61
63
|
|
|
62
|
-
**NOTE:** **Now you can trade off between affiliation precision and recall**
|
|
63
|
-
|
|
64
|
-
<img src = "assets/citation_world_map.png" width=800>
|
|
64
|
+
**NOTE:** **Now you can trade off between affiliation precision and recall** with the `affiliation_conservative` option. If set to True, we will use the Google Scholar verified official organization name from the citing authors. This is a very conservative approach, since (1) the author needs to self-report it in the affiliation panel, (2) the author needs to verify with the matching email address, and (3) the organization needs to be recorded by Google Scholar. For example, Meta (the company) is not in the list. Many thanks to [Zhijian Liu](https://github.com/zhijian-liu) for the [helpful discussion](https://github.com/ChenLiu-1996/CitationMap/issues/8).
|
|
65
65
|
|
|
66
66
|
|
|
67
67
|
## User Guide
|
|
@@ -90,6 +90,8 @@ Besides, there will be a **CSV file** recording citation information (citing aut
|
|
|
90
90
|
generate_citation_map(scholar_id)
|
|
91
91
|
```
|
|
92
92
|
|
|
93
|
+
Note that in Version 4.0, we will cache the results before identifying affiliations. So if you want to rerun the same author from scratch, you need to delete the cache (default location is 'cache').
|
|
94
|
+
|
|
93
95
|
More input arguments are shown in [the demo script](https://github.com/ChenLiu-1996/CitationMap/blob/main/demo/demo.py).
|
|
94
96
|
|
|
95
97
|
You can take a look at the input arguments (listed below) of the function `generate_citation_map` in case you need those functionalities.
|
|
@@ -107,13 +109,13 @@ Besides, there will be a **CSV file** recording citation information (citing aut
|
|
|
107
109
|
The path to the output csv file.
|
|
108
110
|
cache_folder: str
|
|
109
111
|
(default is 'cache')
|
|
110
|
-
The folder to save intermediate results,
|
|
111
|
-
after finding (author, paper) but before finding the affiliations.
|
|
112
|
+
The folder to save intermediate results, after finding (author, paper) but before finding the affiliations.
|
|
112
113
|
This is because the user might want to try the aggressive vs. conservative approach.
|
|
114
|
+
Set to None if you do not want caching.
|
|
113
115
|
affiliation_conservative: bool
|
|
114
116
|
(default is False)
|
|
115
|
-
If true, we will use a more conservative approach
|
|
116
|
-
If false, we will use a more aggressive approach
|
|
117
|
+
If true, we will use a more conservative approach to identify affiliations.
|
|
118
|
+
If false, we will use a more aggressive approach to identify affiliations.
|
|
117
119
|
num_processes: int
|
|
118
120
|
(default is 16)
|
|
119
121
|
Number of processes for parallel processing.
|
|
@@ -148,9 +150,9 @@ Besides, there will be a **CSV file** recording citation information (citing aut
|
|
|
148
150
|
|
|
149
151
|
## Debug
|
|
150
152
|
|
|
151
|
-
1. `MaxTriesExceededException` or (`[WARNING!] Blocked by CAPTCHA or robot check` for all entries).
|
|
153
|
+
1. `MaxTriesExceededException` or `Exception: Failed to fetch the Google Scholar page` or (`[WARNING!] Blocked by CAPTCHA or robot check` for all entries).
|
|
152
154
|
|
|
153
|
-
- From my experience,
|
|
155
|
+
- From my experience, these are good indicators that your IP address is blocked by Google Scholar due to excessive crawling (using the `scholarly` package).
|
|
154
156
|
- One hot fix I found was to hop on a University VPN and run again. I typically experience this error after running the tool twice, and I need to disconnect and reconnect my VPN to "unblock" myself.
|
|
155
157
|
- In case this does not help, you can try to change IP adress and reduce the number of processes (e.g., setting `num_processes=1`).
|
|
156
158
|
- If you get `[WARNING!] Blocked by CAPTCHA or robot check` no more than several times, it's not a big deal especially if you have many citing authors.
|
|
@@ -174,7 +176,16 @@ Besides, there will be a **CSV file** recording citation information (citing aut
|
|
|
174
176
|
```
|
|
175
177
|
|
|
176
178
|
## Changelog
|
|
177
|
-
|
|
179
|
+
<details>
|
|
180
|
+
<summary>Version 4.0 (Aug 2, 2024)</summary>
|
|
181
|
+
<br>
|
|
182
|
+
|
|
183
|
+
1. **Now you can trade off between precision and recall as we identify the affiliations.**
|
|
184
|
+
2. Added caching before identifying the affiliations, since users might want to try both the conservative and aggressive approaches.
|
|
185
|
+
3. Slight optimization in the affiliation to geocode stage by adding early breaking if successful.
|
|
186
|
+
|
|
187
|
+
</details>
|
|
188
|
+
|
|
178
189
|
|
|
179
190
|
<details>
|
|
180
191
|
<summary>Version 3.11 (Jul 28, 2024)</summary>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|