forked from DerwenAI/pytextrank
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
100 lines (83 loc) · 3.63 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# type: ignore
import importlib.util
import pathlib
import setuptools
import typing
KEYWORDS = [
"biased textrank",
"entity linking",
"extractive summarization",
"graph algorithms",
"knowledge graph",
"natural language processing",
"nlp",
"parsing",
"phrase extraction",
"pipeline component",
"positionrank",
"spacy",
"text analytics",
"textgraphs",
"textrank",
"topicrank",
]
def parse_requirements_file (filename: str) -> typing.List:
"""read and parse a Python `requirements.txt` file, returning as a list of str"""
results: list = []
with pathlib.Path(filename).open() as f:
for l in f.readlines():
results.append(l.strip().replace(" ", "").split("#")[0])
return results
if __name__ == "__main__":
spec = importlib.util.spec_from_file_location("pytextrank.version", "pytextrank/version.py")
pytr_version = importlib.util.module_from_spec(spec)
spec.loader.exec_module(pytr_version)
pytr_version._check_version() # pylint: disable=W0212
base_packages = parse_requirements_file("requirements.txt")
docs_packages = parse_requirements_file("requirements-dev.txt")
viz_packages = parse_requirements_file("requirements-viz.txt")
setuptools.setup(
name="pytextrank",
version = pytr_version.__version__,
python_requires = ">=" + pytr_version._versify(pytr_version.MIN_PY_VERSION), # pylint: disable=W0212
packages = setuptools.find_packages(exclude=[ "docs", "examples" ]),
install_requires = base_packages,
extras_require = {
"base": base_packages,
"docs": docs_packages,
"viz": viz_packages,
},
author="Paco Nathan",
author_email="paco@derwen.ai",
license="MIT",
description="Python implementation of TextRank as a spaCy pipeline extension, for graph-based natural language work plus related knowledge graph practices; used for for phrase extraction and lightweight extractive summarization of text documents.",
long_description = pathlib.Path("README.md").read_text(),
long_description_content_type = "text/markdown",
keywords = ", ".join(KEYWORDS),
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Intended Audience :: Information Technology",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Scientific/Engineering :: Human Machine Interfaces",
"Topic :: Scientific/Engineering :: Information Analysis",
"Topic :: Text Processing :: General",
"Topic :: Text Processing :: Indexing",
"Topic :: Text Processing :: Linguistic",
],
url = "https://derwen.ai/docs/ptr/",
project_urls = {
"Source": "http://github.com/DerwenAI/pytextrank",
"spaCy uniVerse": "https://spacy.io/universe/project/spacy-pytextrank",
"Issue Tracker": "https://github.com/DerwenAI/pytextrank/issues",
"Discussion Forum": "https://www.linkedin.com/groups/6725785/",
"StackOverflow": "https://stackoverflow.com/search?q=pytextrank",
"Citations": "https://scholar.google.com/scholar?q=related:5tl6J4xZlCIJ:scholar.google.com/&scioq=&hl=en&as_sdt=0,5",
},
zip_safe=False,
)