PyRuSH 1.0.8.dev6__tar.gz → 1.0.9__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.
- PyRuSH-1.0.9/LICENSE +21 -0
- PyRuSH-1.0.9/PKG-INFO +91 -0
- PyRuSH-1.0.9/PyRuSH/StaticSentencizerFun.cpp +8092 -0
- {PyRuSH-1.0.8.dev6 → PyRuSH-1.0.9}/PyRuSH/__init__.py +1 -1
- PyRuSH-1.0.9/PyRuSH.egg-info/PKG-INFO +91 -0
- {PyRuSH-1.0.8.dev6 → PyRuSH-1.0.9}/PyRuSH.egg-info/SOURCES.txt +3 -1
- PyRuSH-1.0.9/PyRuSH.egg-info/requires.txt +10 -0
- PyRuSH-1.0.9/pyproject.toml +29 -0
- PyRuSH-1.0.9/requirements.txt +6 -0
- {PyRuSH-1.0.8.dev6 → PyRuSH-1.0.9}/setup.cfg +1 -1
- {PyRuSH-1.0.8.dev6 → PyRuSH-1.0.9}/setup.py +20 -23
- PyRuSH-1.0.8.dev6/PKG-INFO +0 -78
- PyRuSH-1.0.8.dev6/PyRuSH/StaticSentencizerFun.cpp +0 -4728
- PyRuSH-1.0.8.dev6/PyRuSH/version.py +0 -20
- PyRuSH-1.0.8.dev6/PyRuSH.egg-info/PKG-INFO +0 -78
- PyRuSH-1.0.8.dev6/PyRuSH.egg-info/requires.txt +0 -6
- PyRuSH-1.0.8.dev6/pyproject.toml +0 -2
- PyRuSH-1.0.8.dev6/requirements.txt +0 -6
- {PyRuSH-1.0.8.dev6 → PyRuSH-1.0.9}/MANIFEST.in +0 -0
- {PyRuSH-1.0.8.dev6 → PyRuSH-1.0.9}/PyRuSH/PyRuSHSentencizer.py +0 -0
- {PyRuSH-1.0.8.dev6 → PyRuSH-1.0.9}/PyRuSH/RuSH.py +0 -0
- {PyRuSH-1.0.8.dev6 → PyRuSH-1.0.9}/PyRuSH/StaticSentencizerFun.pyx +0 -0
- {PyRuSH-1.0.8.dev6 → PyRuSH-1.0.9}/PyRuSH.egg-info/dependency_links.txt +0 -0
- {PyRuSH-1.0.8.dev6 → PyRuSH-1.0.9}/PyRuSH.egg-info/not-zip-safe +0 -0
- {PyRuSH-1.0.8.dev6 → PyRuSH-1.0.9}/PyRuSH.egg-info/top_level.txt +0 -0
- {PyRuSH-1.0.8.dev6 → PyRuSH-1.0.9}/README.rst +0 -0
- {PyRuSH-1.0.8.dev6 → PyRuSH-1.0.9}/conf/rush_rules.tsv +0 -0
PyRuSH-1.0.9/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 Jianlin Shi
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
PyRuSH-1.0.9/PKG-INFO
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: PyRuSH
|
|
3
|
+
Version: 1.0.9
|
|
4
|
+
Summary: PyRuSH is the python implementation of RuSH (Rule-based sentence Segmenter using Hashing), which is originally developed using Java. RuSH is an efficient, reliable, and easy adaptable rule-based sentence segmentation solution. It is specifically designed to handle the telegraphic written text in clinical note. It leverages a nested hash table to execute simultaneous rule processing, which reduces the impact of the rule-base growth on execution time and eliminates the effect of rule order on accuracy.
|
|
5
|
+
Home-page: https://github.com/jianlins/PyRuSH
|
|
6
|
+
Author: Jianlin
|
|
7
|
+
Author-email: Jianlin <jianlinshi.cn@gmail.com>
|
|
8
|
+
License: MIT License
|
|
9
|
+
|
|
10
|
+
Copyright (c) 2020 Jianlin Shi
|
|
11
|
+
|
|
12
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
13
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
14
|
+
in the Software without restriction, including without limitation the rights
|
|
15
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
16
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
17
|
+
furnished to do so, subject to the following conditions:
|
|
18
|
+
|
|
19
|
+
The above copyright notice and this permission notice shall be included in all
|
|
20
|
+
copies or substantial portions of the Software.
|
|
21
|
+
|
|
22
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
23
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
24
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
25
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
26
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
27
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
28
|
+
SOFTWARE.
|
|
29
|
+
|
|
30
|
+
Project-URL: Source, https://github.com/jianlins/PyRuSH
|
|
31
|
+
Keywords: PyRuSH,NLP,sentenczier,sentence segmentation
|
|
32
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
33
|
+
Classifier: Programming Language :: Python :: 3
|
|
34
|
+
Requires-Python: >=3.6
|
|
35
|
+
Description-Content-Type: text/x-rst
|
|
36
|
+
License-File: LICENSE
|
|
37
|
+
|
|
38
|
+
PyRuSH
|
|
39
|
+
=========
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
PyRuSH is the python implementation of `RuSH <https://github.com/jianlins/RuSH>`_ (**Ru** le-based sentence **S** egmenter using **H** ashing), which is originally developed using Java. RuSH is an efficient, reliable, and easy adaptable rule-based sentence segmentation solution. It is specifically designed to handle the telegraphic written text in clinical note. It leverages a nested hash table to execute simultaneous rule processing, which reduces the impact of the rule-base growth on execution time and eliminates the effect of rule order on accuracy.
|
|
44
|
+
|
|
45
|
+
If you wish to cite RuSH in a publication, please use:
|
|
46
|
+
|
|
47
|
+
Jianlin Shi ; Danielle Mowery ; Kristina M. Doing-Harris ; John F. Hurdle.RuSH: a Rule-based Segmentation Tool Using Hashing for Extremely Accurate Sentence Segmentation of Clinical Text. AMIA Annu Symp Proc. 2016: 1587.
|
|
48
|
+
|
|
49
|
+
The full text can be found `here <https://knowledge.amia.org/amia-63300-1.3360278/t005-1.3362920/f005-1.3362921/2495498-1.3363244/2495498-1.3363247?timeStamp=1479743941616>`_.
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
Installation
|
|
54
|
+
------------
|
|
55
|
+
|
|
56
|
+
pip install PyRuSH
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
How to use
|
|
60
|
+
------------
|
|
61
|
+
|
|
62
|
+
A standalone RuSH class is available to be directly used in your code. From 1.0.4, pyRush adopt spaCy 3.x api to initiate an component.
|
|
63
|
+
|
|
64
|
+
>>> from PyRuSH import RuSH
|
|
65
|
+
>>> input_str = "The patient was admitted on 03/26/08\n and was started on IV antibiotics elevation" +\
|
|
66
|
+
>>> ", was also counseled to minimizing the cigarette smoking. The patient had edema\n\n" +\
|
|
67
|
+
>>> "\n of his bilateral lower extremities. The hospital consult was also obtained to " +\
|
|
68
|
+
>>> "address edema issue question was related to his liver hepatitis C. Hospital consult" +\
|
|
69
|
+
>>> " was obtained. This included an ultrasound of his abdomen, which showed just mild " +\
|
|
70
|
+
>>> "cirrhosis. "
|
|
71
|
+
>>> rush = RuSH('../conf/rush_rules.tsv')
|
|
72
|
+
>>> sentences=rush.segToSentenceSpans(input_str)
|
|
73
|
+
>>> for sentence in sentences:
|
|
74
|
+
>>> print("Sentence({0}-{1}):\t>{2}<".format(sentence.begin, sentence.end, input_str[sentence.begin:sentence.end]))
|
|
75
|
+
|
|
76
|
+
Spacy Componentized PyRuSH
|
|
77
|
+
---------------------------
|
|
78
|
+
Start from version 1.0.3, PyRuSH adds Spacy compatible Sentencizer component: PyRuSHSentencizer.
|
|
79
|
+
|
|
80
|
+
>>> from PyRuSH import PyRuSHSentencizer
|
|
81
|
+
>>> from spacy.lang.en import English
|
|
82
|
+
>>> nlp = English()
|
|
83
|
+
>>> nlp.add_pipe("medspacy_pyrush")
|
|
84
|
+
>>> doc = nlp("This is a sentence. This is another sentence.")
|
|
85
|
+
>>> print('\n'.join([str(s) for s in doc.sents]))
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
A Colab Notebook Demo
|
|
90
|
+
---------------------------
|
|
91
|
+
Feel free to try this runnable `Colab notebook Demo <https://colab.research.google.com/drive/1gX9MzZTQiPw8G3x_vUwZbiSXGtbI0uIX?usp=sharing>`_
|