Skip to content

Commit 5a92184

Browse files
committed
prep for release
1 parent 70ea807 commit 5a92184

File tree

17 files changed

+300
-196
lines changed

17 files changed

+300
-196
lines changed

MANIFEST.in

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1+
include CITATION
2+
include LICENSE
3+
include README.md
4+
include pyproject.toml
5+
include requirements.txt
6+
include setup.py
7+
include tests/*.py
8+
prune .ipynb_checkpoints
19
# added by check-manifest
210
include *.md
311
include *.py
412
include *.txt
513
include *.yaml
614
include *.yml
7-
include CITATION
8-
include LICENSE
915
include pylintrc
1016
recursive-include bin *.py
1117
recursive-include bin *.sh

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ Source code for **PyTextRank** plus its logo, documentation, and examples
132132
have an [MIT license](https://spdx.org/licenses/MIT.html) which is
133133
succinct and simplifies use in commercial applications.
134134

135-
All materials herein are Copyright © 2016-2023 Derwen, Inc.
135+
All materials herein are Copyright © 2016-2024 Derwen, Inc.
136136

137137

138138
## Attribution

SECURITY.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
Versions which are currently being supported with security updates:
6+
7+
| Version | Supported |
8+
| ------- | ------------------ |
9+
| > 0.2 | :white_check_mark: |
10+
11+
## Reporting a Vulnerability
12+
13+
To report a vulnerability, please create a new [*issue*](https://github.com/DerwenAI/pytextrank/issues).
14+
We will be notified immediately, and will attempt to respond on the reported issue immediately.

bin/nb_md.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash -e
1+
#!/bin/bash -e -x
22

33
for notebook_path in examples/*.ipynb; do
44
[ -e "$notebook_path" ] || continue
@@ -8,6 +8,6 @@ for notebook_path in examples/*.ipynb; do
88

99
cp $notebook_path docs/$notebook
1010
jupyter nbconvert docs/$notebook --to markdown
11-
python bin/vis_doc.py docs/"$stem".md
11+
python3 bin/vis_doc.py docs/"$stem".md
1212
rm docs/$notebook
13-
done
13+
done

bin/preview.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33

4-
from flask import Flask, redirect, send_from_directory, url_for # pylint: disable=E0401
4+
from flask import Flask, redirect, send_from_directory, url_for # pylint: disable=E0401
55
from pathlib import PurePosixPath
66
import os
77

bin/push_pypi.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
#!/bin/bash -e
1+
#!/bin/bash -e -x
22

3-
## debugging the uploaded README:
4-
# pandoc README.md --from markdown --to rst -s -o README.rst
3+
rm -rf dist build pytextrank.egg-info
4+
python3 -m build
5+
twine check dist/*
56

6-
rm -rf dist
7-
python setup.py sdist bdist_wheel
8-
twine upload --verbose dist/*
7+
# this assumes the use of `~/.pypirc`
8+
# https://packaging.python.org/en/latest/specifications/pypirc/
9+
10+
twine upload ./dist/* --verbose

docs/ack.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ Computer Science (advisor: [Douglas Lenat](https://en.wikipedia.org/wiki/Douglas
4747
with additional work in Design and Linguistics.
4848
His business experience includes:
4949
Director, VP, and CTO positions leading data teams and machine learning projects;
50-
former CTO/Board member at two publicly-traded tech firms on NASDAQ OTC:BB;
51-
and an equity partner at [Amplify Partners](https://derwen.ai/s/hcxhybks9nbh).
50+
former CTO/Board member at two publicly-traded tech firms on NASDAQ OTC:BB.
5251
Cited in 2015 as one of the
5352
[Top 30 People in Big Data and Analytics](http://www.kdnuggets.com/2015/02/top-30-people-big-data-analytics.html)
5453
by Innovation Enterprise.
@@ -67,16 +66,15 @@ by Innovation Enterprise.
6766
[Cascading](https://www.cascading.org/)
6867
* consultant to enterprise organizations for [data strategy](../glossary/#data-strategy);
6968
advisor to several AI start-ups, including
70-
[Recognai](https://derwen.ai/s/hk4g),
69+
[Argilla](https://derwen.ai/s/mz2xj9bsz2jx),
7170
[KUNGFU.AI](https://derwen.ai/s/rwg8prbgqp36),
72-
[Primer](https://derwen.ai/s/tm9jxzcm67hc)
71+
[DataSpartan](https://derwen.ai/s/hxsfttck3dkx)
7372

7473
As an author/speaker/instructor, Paco has taught many people (+9000)
7574
in industry across a range of topics –
7675
[*data science*](../glossary/#data-science),
7776
[*natural language*](../glossary/#natural-language),
7877
[*cloud computing*](../glossary/#cloud-computing),
79-
[*reinforcement learning*](../glossary/#reinforcement-learning),
8078
[*computable content*](../glossary/#computable-content),
8179
etc. –
8280
and through guest lectures at
@@ -115,9 +113,9 @@ Source code for **pytextrank** plus its logo, documentation, and examples
115113
have an [MIT license](https://spdx.org/licenses/MIT.html) which is
116114
succinct and simplifies use in commercial applications.
117115

118-
All materials herein are Copyright © 2016-2023 Derwen, Inc.
116+
All materials herein are Copyright © 2016-2024 Derwen, Inc.
119117

120-
[![logo for Derwen, Inc.](https://derwen.ai/static/block_logo.png)](https://derwen.ai/)
118+
[![logo for Derwen, Inc.](https://derwen.ai/static/design/block_logo.png)](https://derwen.ai/)
121119

122120

123121
## Production Use Cases

docs/index.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,6 @@ complementary, hybrid AI solutions.
7878
Links for other open source community resources:
7979

8080
* [Issue Tracker](https://github.com/DerwenAI/pytextrank/issues)
81-
* [Project Board](https://github.com/DerwenAI/pytextrank/projects/1)
82-
* [Milestones](https://github.com/DerwenAI/pytextrank/milestones)
8381
* [spaCy uniVerse](https://spacy.io/universe/project/spacy-pytextrank)
8482

8583
Other good ways to help troubleshoot issues:
@@ -94,7 +92,7 @@ get help about **pytextrank** and related
9492
topics.
9593

9694
* [community Slack](https://knowledgegraphconf.slack.com/ssb/redirect) – specifically on the `#ask` channel
97-
* [*Graph-Based Data Science*](https://www.linkedin.com/groups/6725785/) group on LinkedIn – join to receive related updates, news, conference coupons, etc.
95+
* [*Graph Data Science*](https://www.linkedin.com/groups/6725785/) group on LinkedIn – join to receive related updates, news, conference coupons, etc.
9896

9997
For related course materials and training, please check for calendar
10098
updates in the article

docs/ref.md

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# Reference: `pytextrank` package
2+
Package definitions for the `pytextrank` library.
3+
4+
25
## [`BaseTextRankFactory` class](#BaseTextRankFactory)
36

47
A factory class that provides the document with its instance of
@@ -118,7 +121,7 @@ list of ranked phrases, in descending order
118121

119122
---
120123
#### [`get_personalization` method](#pytextrank.BaseTextRank.get_personalization)
121-
[*\[source\]*](https://github.com/DerwenAI/pytextrank/blob/main/pytextrank/base.py#L376)
124+
[*\[source\]*](https://github.com/DerwenAI/pytextrank/blob/main/pytextrank/base.py#L385)
122125

123126
```python
124127
get_personalization()
@@ -136,7 +139,7 @@ Defaults to a no-op for the base *TextRank* algorithm.
136139

137140
---
138141
#### [`get_unit_vector` method](#pytextrank.BaseTextRank.get_unit_vector)
139-
[*\[source\]*](https://github.com/DerwenAI/pytextrank/blob/main/pytextrank/base.py#L638)
142+
[*\[source\]*](https://github.com/DerwenAI/pytextrank/blob/main/pytextrank/base.py#L649)
140143

141144
```python
142145
get_unit_vector(limit_phrases)
@@ -158,7 +161,7 @@ the unit vector, as a list of `VectorElem` objects
158161

159162
---
160163
#### [`calc_sent_dist` method](#pytextrank.BaseTextRank.calc_sent_dist)
161-
[*\[source\]*](https://github.com/DerwenAI/pytextrank/blob/main/pytextrank/base.py#L682)
164+
[*\[source\]*](https://github.com/DerwenAI/pytextrank/blob/main/pytextrank/base.py#L693)
162165

163166
```python
164167
calc_sent_dist(limit_phrases)
@@ -176,7 +179,7 @@ a list of sentence distance measures
176179

177180
---
178181
#### [`segment_paragraphs` method](#pytextrank.BaseTextRank.segment_paragraphs)
179-
[*\[source\]*](https://github.com/DerwenAI/pytextrank/blob/main/pytextrank/base.py#L731)
182+
[*\[source\]*](https://github.com/DerwenAI/pytextrank/blob/main/pytextrank/base.py#L742)
180183

181184
```python
182185
segment_paragraphs(sent_dist)
@@ -193,7 +196,7 @@ a list of Paragraph data objects
193196

194197
---
195198
#### [`summary` method](#pytextrank.BaseTextRank.summary)
196-
[*\[source\]*](https://github.com/DerwenAI/pytextrank/blob/main/pytextrank/base.py#L786)
199+
[*\[source\]*](https://github.com/DerwenAI/pytextrank/blob/main/pytextrank/base.py#L797)
197200

198201
```python
199202
summary(limit_phrases=10, limit_sentences=4, preserve_order=False, level="sentence")
@@ -221,7 +224,7 @@ texts for sentences, in order
221224

222225
---
223226
#### [`write_dot` method](#pytextrank.BaseTextRank.write_dot)
224-
[*\[source\]*](https://github.com/DerwenAI/pytextrank/blob/main/pytextrank/base.py#L860)
227+
[*\[source\]*](https://github.com/DerwenAI/pytextrank/blob/main/pytextrank/base.py#L871)
225228

226229
```python
227230
write_dot(path="graph.dot")
@@ -235,7 +238,7 @@ path for the output file; defaults to `"graph.dot"`
235238

236239
---
237240
#### [`plot_keyphrases` method](#pytextrank.BaseTextRank.plot_keyphrases)
238-
[*\[source\]*](https://github.com/DerwenAI/pytextrank/blob/main/pytextrank/base.py#L890)
241+
[*\[source\]*](https://github.com/DerwenAI/pytextrank/blob/main/pytextrank/base.py#L901)
239242

240243
```python
241244
plot_keyphrases()
@@ -257,7 +260,7 @@ A factory class that provides the document with its instance of
257260

258261
---
259262
#### [`__init__` method](#pytextrank.TopicRankFactory.__init__)
260-
[*\[source\]*](https://github.com/DerwenAI/pytextrank/blob/main/pytextrank/topicrank.py#L31)
263+
[*\[source\]*](https://github.com/DerwenAI/pytextrank/blob/main/pytextrank/topicrank.py#L32)
261264

262265
```python
263266
__init__(edge_weight=1.0, pos_kept=None, token_lookback=3, scrubber=None, stopwords=None, threshold=0.25, method="average")
@@ -268,7 +271,7 @@ Constructor for the factory class.
268271

269272
---
270273
#### [`__call__` method](#pytextrank.TopicRankFactory.__call__)
271-
[*\[source\]*](https://github.com/DerwenAI/pytextrank/blob/main/pytextrank/topicrank.py#L58)
274+
[*\[source\]*](https://github.com/DerwenAI/pytextrank/blob/main/pytextrank/topicrank.py#L59)
272275

273276
```python
274277
__call__(doc)
@@ -315,7 +318,7 @@ Algorithm Overview:
315318

316319
---
317320
#### [`__init__` method](#pytextrank.TopicRank.__init__)
318-
[*\[source\]*](https://github.com/DerwenAI/pytextrank/blob/main/pytextrank/topicrank.py#L120)
321+
[*\[source\]*](https://github.com/DerwenAI/pytextrank/blob/main/pytextrank/topicrank.py#L121)
319322

320323
```python
321324
__init__(doc, edge_weight, pos_kept, token_lookback, scrubber, stopwords, threshold, method)
@@ -347,7 +350,7 @@ clustering method used in *TopicRank* candidate clustering: see [`scipy.cluster.
347350

348351
---
349352
#### [`calc_textrank` method](#pytextrank.TopicRank.calc_textrank)
350-
[*\[source\]*](https://github.com/DerwenAI/pytextrank/blob/main/pytextrank/topicrank.py#L307)
353+
[*\[source\]*](https://github.com/DerwenAI/pytextrank/blob/main/pytextrank/topicrank.py#L318)
351354

352355
```python
353356
calc_textrank()
@@ -364,7 +367,7 @@ list of ranked phrases, in descending order
364367

365368
---
366369
#### [`reset` method](#pytextrank.TopicRank.reset)
367-
[*\[source\]*](https://github.com/DerwenAI/pytextrank/blob/main/pytextrank/topicrank.py#L367)
370+
[*\[source\]*](https://github.com/DerwenAI/pytextrank/blob/main/pytextrank/topicrank.py#L378)
368371

369372
```python
370373
reset()
@@ -677,6 +680,21 @@ the filtered text representing as a list of lines
677680

678681

679682

683+
---
684+
#### [`get_repo_version` function](#pytextrank.get_repo_version)
685+
[*\[source\]*](https://github.com/DerwenAI/pytextrank/blob/main/pytextrank/version.py#L49)
686+
687+
```python
688+
get_repo_version()
689+
```
690+
Access the Git repository information and return items to identify
691+
the version/commit running in production.
692+
693+
* *returns* : `typing.Tuple[str, str]`
694+
version tag and commit hash
695+
696+
697+
680698
---
681699
#### [`groupby_apply` function](#pytextrank.groupby_apply)
682700
[*\[source\]*](https://github.com/DerwenAI/pytextrank/blob/main/pytextrank/util.py#L14)

pkg_doc.cfg

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"src_url": "https://github.com/DerwenAI/pytextrank/blob/main",
3+
4+
"module": "pytextrank",
5+
6+
"classes": [
7+
"BaseTextRankFactory",
8+
"BaseTextRank",
9+
"TopicRankFactory",
10+
"TopicRank",
11+
"PositionRankFactory",
12+
"PositionRank",
13+
"BiasedTextRankFactory",
14+
"BiasedTextRank",
15+
"Lemma",
16+
"Phrase",
17+
"Sentence",
18+
"VectorElem"
19+
]
20+
}

0 commit comments

Comments
 (0)