gismap 0.1.0__py3-none-any.whl
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.
- gismap/__init__.py +20 -0
- gismap/author.py +0 -0
- gismap/gismap.py +1 -0
- gismap/gismo.py +379 -0
- gismap/lab/__init__.py +10 -0
- gismap/lab/graph.py +234 -0
- gismap/lab/lab.py +152 -0
- gismap/lab/lip6.py +43 -0
- gismap/lab/toulouse.py +47 -0
- gismap/lab/vis.py +171 -0
- gismap/search.py +215 -0
- gismap/sources/__init__.py +0 -0
- gismap/sources/dblp.py +162 -0
- gismap/sources/hal.py +272 -0
- gismap/sources/models.py +31 -0
- gismap/sources/multi.py +135 -0
- gismap/utils/__init__.py +0 -0
- gismap/utils/common.py +60 -0
- gismap/utils/logger.py +4 -0
- gismap/utils/requests.py +33 -0
- gismap/utils/text.py +93 -0
- gismap-0.1.0.dist-info/METADATA +62 -0
- gismap-0.1.0.dist-info/RECORD +25 -0
- gismap-0.1.0.dist-info/WHEEL +4 -0
- gismap-0.1.0.dist-info/licenses/AUTHORS.md +9 -0
gismap/utils/text.py
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
from bof.fuzz import Process
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class Corrector:
|
|
5
|
+
"""
|
|
6
|
+
A simple word corrector base on input vocabulary. Short words are discarded.
|
|
7
|
+
|
|
8
|
+
Parameters
|
|
9
|
+
----------
|
|
10
|
+
voc: :class:`list`
|
|
11
|
+
Words (each entry may contain multiple words).
|
|
12
|
+
score_cutoff: :class:`int`, default=20
|
|
13
|
+
Threshold for correction.
|
|
14
|
+
min_length: :class:`int`, default=3
|
|
15
|
+
Minimal number of caracters for correction to kick in.
|
|
16
|
+
|
|
17
|
+
Examples
|
|
18
|
+
--------
|
|
19
|
+
|
|
20
|
+
>>> vocabulary = ['My Taylor Swift is Rich']
|
|
21
|
+
>>> phrase = "How riche ise Tailor Swyft"
|
|
22
|
+
>>> cor = Corrector(vocabulary, min_length=4)
|
|
23
|
+
>>> cor(phrase)
|
|
24
|
+
'How rich ise taylor swift'
|
|
25
|
+
>>> cor = Corrector(vocabulary, min_length=2)
|
|
26
|
+
>>> cor(phrase)
|
|
27
|
+
'How rich is taylor swift'
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
def __init__(self, voc, score_cutoff=20, min_length=3):
|
|
31
|
+
self.voc = {k.lower() for w in voc for k in w.split() if len(k) >= min_length}
|
|
32
|
+
self.cutoff = score_cutoff
|
|
33
|
+
self.min_length = min_length
|
|
34
|
+
self.p = Process()
|
|
35
|
+
self.p.fit(list(self.voc))
|
|
36
|
+
|
|
37
|
+
def correct_word(self, w):
|
|
38
|
+
if len(w) < self.min_length or w.lower() in self.voc:
|
|
39
|
+
return w
|
|
40
|
+
ww = self.p.extractOne(w, score_cutoff=self.cutoff)
|
|
41
|
+
return ww[0] if ww is not None else w
|
|
42
|
+
|
|
43
|
+
def __call__(self, text):
|
|
44
|
+
return " ".join(self.correct_word(w) for w in text.split())
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def reduce_keywords(kws):
|
|
48
|
+
"""
|
|
49
|
+
Remove redundant subparts.
|
|
50
|
+
|
|
51
|
+
Parameters
|
|
52
|
+
----------
|
|
53
|
+
kws: :class:`list`
|
|
54
|
+
List of words / co-locations.
|
|
55
|
+
|
|
56
|
+
Returns
|
|
57
|
+
-------
|
|
58
|
+
:class:`list`
|
|
59
|
+
Reduced list
|
|
60
|
+
|
|
61
|
+
Examples
|
|
62
|
+
--------
|
|
63
|
+
|
|
64
|
+
>>> reduce_keywords(['P2P', 'Millimeter Waves', 'Networks', 'P2P Networks', 'Waves'])
|
|
65
|
+
['Millimeter Waves', 'P2P Networks']
|
|
66
|
+
"""
|
|
67
|
+
indices = []
|
|
68
|
+
for i, kw1 in enumerate(kws):
|
|
69
|
+
accept = True
|
|
70
|
+
for j, kw2 in enumerate(kws):
|
|
71
|
+
if j != i and kw1 in kw2:
|
|
72
|
+
accept = False
|
|
73
|
+
break
|
|
74
|
+
if accept:
|
|
75
|
+
indices.append(i)
|
|
76
|
+
return [kws[i] for i in indices]
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def clean_aliases(name, alias_list):
|
|
80
|
+
"""
|
|
81
|
+
Parameters
|
|
82
|
+
----------
|
|
83
|
+
name: :class:`str`
|
|
84
|
+
Main name.
|
|
85
|
+
alias_list: :class:`list` or :class:`set`
|
|
86
|
+
Aliases.
|
|
87
|
+
|
|
88
|
+
Returns
|
|
89
|
+
-------
|
|
90
|
+
:class:`list`
|
|
91
|
+
Aliases deduped, sorted, and with main name removed.
|
|
92
|
+
"""
|
|
93
|
+
return sorted(set(n for n in alias_list if n != name))
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: gismap
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: GISMAP leverages DBLP and HAL databases to provide cartography tools for you and your lab.
|
|
5
|
+
Project-URL: Repository, https://github.com/balouf/gismap
|
|
6
|
+
Project-URL: Documentation, https://balouf.github.io/gismap
|
|
7
|
+
Author-email: Fabien Mathieu <fabien.mathieu@normalesup.org>
|
|
8
|
+
Maintainer-email: Fabien Mathieu <fabien.mathieu@normalesup.org>
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: AUTHORS.md
|
|
11
|
+
Requires-Python: >=3.10
|
|
12
|
+
Requires-Dist: bof>=0.3.5
|
|
13
|
+
Requires-Dist: gismo>=0.5.2
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
|
|
16
|
+
# Generic Information Search: Mapping and Analysis of Publications
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
[](https://pypi.python.org/pypi/gismap)
|
|
20
|
+
[](https://github.com/balouf/gismap/actions?query=workflow%3Abuild)
|
|
21
|
+
[](https://github.com/balouf/gismap/actions?query=workflow%3Adocs)
|
|
22
|
+
[](https://opensource.org/licenses/MIT)
|
|
23
|
+
[](https://codecov.io/gh/balouf/gismap/tree/main)
|
|
24
|
+
|
|
25
|
+
GISMAP leverages DBLP and HAL databases to provide cartography tools for you and your lab.
|
|
26
|
+
|
|
27
|
+
- Free software: MIT
|
|
28
|
+
- Documentation: <https://balouf.github.io/gismap/>.
|
|
29
|
+
- Github: <https://github.com/balouf/gismap>
|
|
30
|
+
|
|
31
|
+
## Features
|
|
32
|
+
|
|
33
|
+
- Can be used by all researchers in Computer Science (DBLP endpoint) or based in France (HAL endpoint).
|
|
34
|
+
- Aggregate publications from multiple databases, including multiple author keys inside the same database.
|
|
35
|
+
- Automatically keeps track of a Lab/Department members and publications.
|
|
36
|
+
- Builds interactive collaboration graphs.
|
|
37
|
+
|
|
38
|
+
## Quickstart
|
|
39
|
+
|
|
40
|
+
Install GISMAP:
|
|
41
|
+
|
|
42
|
+
```console
|
|
43
|
+
$ pip install gismap
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Use GISMAP to produce a collaboration graph (HTML):
|
|
47
|
+
|
|
48
|
+
```pycon
|
|
49
|
+
>>> from gismap.sources.hal import HAL
|
|
50
|
+
>>> from gismap.lab import ListLab, lab2graph
|
|
51
|
+
>>> lab = ListLab(["Mathilde Labbé", "Anne Reverseau", "David Martens", "Marcela Scibiorska", "Nathalie Grande"], dbs=[HAL])
|
|
52
|
+
>>> lab.update_authors()
|
|
53
|
+
>>> lab.update_publis()
|
|
54
|
+
>>> collabs = lab2graph(lab)
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Credits
|
|
58
|
+
|
|
59
|
+
This package was created with [Cookiecutter][CC] and the [Package Helper 3][PH3] project template.
|
|
60
|
+
|
|
61
|
+
[CC]: <https://github.com/audreyr/cookiecutter>
|
|
62
|
+
[PH3]: <https://balouf.github.io/package-helper-3/>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
gismap/__init__.py,sha256=TFBKB5AwAxzmcpIB48EpT4Ud9S417i5Obh85w2t1-Zc,598
|
|
2
|
+
gismap/author.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
+
gismap/gismap.py,sha256=h0hwdogXGFqerm-5ZPeT-irPn91pCcQRjiHThXsRzEk,19
|
|
4
|
+
gismap/gismo.py,sha256=kBzvlo-fqcvEgwQt-c_hHkfI1oTjBbKKb54vM8il_nI,6295
|
|
5
|
+
gismap/search.py,sha256=nsUoDsFGeEtvCZ0dB7ooRPC_6qsazkiWx_oM7dHdNV4,4932
|
|
6
|
+
gismap/lab/__init__.py,sha256=UQVY6Sk7o9O0YREArXA8_8ZfrDO0JYLy8tikSHBEbzo,377
|
|
7
|
+
gismap/lab/graph.py,sha256=LOHNnmFqgsZc7YGUcFQ1GKl0DFiStFfoYqx-2IrjFAk,6525
|
|
8
|
+
gismap/lab/lab.py,sha256=-mBcHcP9JaBAiiZlWRygac5MQdO0b6AriHWiLgTveWc,4224
|
|
9
|
+
gismap/lab/lip6.py,sha256=yRx-RWgcGhGWUk_oyfgC9QYJSVnATnp6YlNvaOlr8Gw,1410
|
|
10
|
+
gismap/lab/toulouse.py,sha256=KkzNOCFt3OU6pDJmDmli6wRNuMwH8CPXHj_S6aOcYeg,1462
|
|
11
|
+
gismap/lab/vis.py,sha256=1QgLgLQjcB7rGiZ946lhLU1kR38oXp_Y8l8U-Ukn65k,5497
|
|
12
|
+
gismap/sources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
|
+
gismap/sources/dblp.py,sha256=5ZKngU66xgXffmiGHsbXGXJfU_NIybnuzXXZPcWIZoE,5381
|
|
14
|
+
gismap/sources/hal.py,sha256=mWyiG12wXE9A8w81YGFicx8Yy9mX-anvIEoBueU2U6Q,9136
|
|
15
|
+
gismap/sources/models.py,sha256=yJPBXcJO6MgOrSXgpGPepHDDtniJP1OsK8OSz__VzYc,543
|
|
16
|
+
gismap/sources/multi.py,sha256=jfvBVgmnLT85RaEWcMNCZ8YtmSRuQuq8CkCHWY8u-hc,3515
|
|
17
|
+
gismap/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
18
|
+
gismap/utils/common.py,sha256=BV5mma4aikHyPIhH4theLkiNHaiqLv5_EfxhT0yajZo,1509
|
|
19
|
+
gismap/utils/logger.py,sha256=1YALIaNYKTqeIyyCnYxzvZTK7x4FTSfYYl5CP9IMw8E,86
|
|
20
|
+
gismap/utils/requests.py,sha256=DV5rmyuy7jpMp63kzGXe848pmwMb5397wGHgF0o_0BM,721
|
|
21
|
+
gismap/utils/text.py,sha256=R7tKWevfF4g-LsohF6FeiRdCuNYz4jQ1VcQJIyhwei0,2393
|
|
22
|
+
gismap-0.1.0.dist-info/METADATA,sha256=bTM9vZl81oJ5dUYakrCEL1uAbTZzEgC1AGSePg1TBU8,2499
|
|
23
|
+
gismap-0.1.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
24
|
+
gismap-0.1.0.dist-info/licenses/AUTHORS.md,sha256=oDR4mptVUBMq0WKIpt19Km1Bdfz3cO2NAOVgwVfTO8g,131
|
|
25
|
+
gismap-0.1.0.dist-info/RECORD,,
|