uzmorph-nn 0.1.0__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.
- uzmorph_nn-0.1.0/MANIFEST.in +3 -0
- uzmorph_nn-0.1.0/PKG-INFO +105 -0
- uzmorph_nn-0.1.0/README.md +84 -0
- uzmorph_nn-0.1.0/setup.cfg +4 -0
- uzmorph_nn-0.1.0/setup.py +25 -0
- uzmorph_nn-0.1.0/uzmorph_nn/__init__.py +4 -0
- uzmorph_nn-0.1.0/uzmorph_nn/data/char_vocab.json +51 -0
- uzmorph_nn-0.1.0/uzmorph_nn/data/morph_bilstm.pth +0 -0
- uzmorph_nn-0.1.0/uzmorph_nn/data/tag_vocab.json +748 -0
- uzmorph_nn-0.1.0/uzmorph_nn/model.py +16 -0
- uzmorph_nn-0.1.0/uzmorph_nn/uzmorph_nn.py +106 -0
- uzmorph_nn-0.1.0/uzmorph_nn.egg-info/PKG-INFO +105 -0
- uzmorph_nn-0.1.0/uzmorph_nn.egg-info/SOURCES.txt +14 -0
- uzmorph_nn-0.1.0/uzmorph_nn.egg-info/dependency_links.txt +1 -0
- uzmorph_nn-0.1.0/uzmorph_nn.egg-info/requires.txt +1 -0
- uzmorph_nn-0.1.0/uzmorph_nn.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: uzmorph-nn
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Neural Network Uzbek Morphological Analyzer (BiLSTM, CSE)
|
|
5
|
+
Home-page: https://github.com/UlugbekSalaev/uzmorph_nn
|
|
6
|
+
Author: Ulugbek Salaev
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
+
Classifier: Operating System :: OS Independent
|
|
10
|
+
Requires-Python: >=3.7
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
Requires-Dist: torch
|
|
13
|
+
Dynamic: author
|
|
14
|
+
Dynamic: classifier
|
|
15
|
+
Dynamic: description
|
|
16
|
+
Dynamic: description-content-type
|
|
17
|
+
Dynamic: home-page
|
|
18
|
+
Dynamic: requires-dist
|
|
19
|
+
Dynamic: requires-python
|
|
20
|
+
Dynamic: summary
|
|
21
|
+
|
|
22
|
+
# uzmorph-nn: Uzbek Neural Morphological Analyzer
|
|
23
|
+
|
|
24
|
+
**uzmorph-nn** is a high-accuracy word-level morphological analyzer for the Uzbek language based on a character-level Bidirectional LSTM (BiLSTM) architecture.
|
|
25
|
+
|
|
26
|
+
## Role & Performance
|
|
27
|
+
This package provides a robust foundation for Uzbek NLP tasks. It is specifically optimized for:
|
|
28
|
+
- **Agglutinative Processing**: Efficiently decomposes long chains of suffixes.
|
|
29
|
+
- **Phonological Awareness**: Handles stem changes (allomorphy) and vowel/consonant harmony correctly.
|
|
30
|
+
- **Rule-Augmented Deep Learning**: Built on 100,000+ rules from the Common Stem Expansion (CSE) framework.
|
|
31
|
+
|
|
32
|
+
## Installation
|
|
33
|
+
```bash
|
|
34
|
+
pip install uzmorph-nn
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Quick Start & Usage Examples
|
|
38
|
+
|
|
39
|
+
### 1. Basic Analysis (String Output)
|
|
40
|
+
Great for quick debugging or readable logs.
|
|
41
|
+
```python
|
|
42
|
+
from uzmorph_nn import uzmorph_nn
|
|
43
|
+
|
|
44
|
+
# Initialize the analyzer
|
|
45
|
+
analyzer = uzmorph_nn()
|
|
46
|
+
|
|
47
|
+
# Analyze a word
|
|
48
|
+
result = analyzer.analyze("maktabimizda")
|
|
49
|
+
print(result)
|
|
50
|
+
|
|
51
|
+
# Output:
|
|
52
|
+
# Result: 'maktabimizda' -> Stem: maktab | POS: NOUN | Tags: [possession=1, cases=Locative, plural=1]
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### 2. Structured Data (Dictionary)
|
|
56
|
+
Ideal for integrating into other projects or data processing pipelines.
|
|
57
|
+
```python
|
|
58
|
+
result = analyzer.analyze("kitobim")
|
|
59
|
+
data = result.to_dict()
|
|
60
|
+
print(data)
|
|
61
|
+
|
|
62
|
+
# Output:
|
|
63
|
+
# {
|
|
64
|
+
# "word": "kitobim",
|
|
65
|
+
# "stem": "kitob",
|
|
66
|
+
# "pos": "NOUN",
|
|
67
|
+
# "possession": "1"
|
|
68
|
+
# }
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### 3. API Integration (JSON Output)
|
|
72
|
+
Useful for web services or sending data between different languages.
|
|
73
|
+
```python
|
|
74
|
+
result = analyzer.analyze("yozayapmiz")
|
|
75
|
+
print(result.to_json())
|
|
76
|
+
|
|
77
|
+
# Output:
|
|
78
|
+
# {
|
|
79
|
+
# "word": "yozayapmiz",
|
|
80
|
+
# "stem": "yoz",
|
|
81
|
+
# "pos": "VERB",
|
|
82
|
+
# "aspect": "Progressive",
|
|
83
|
+
# "person": "1",
|
|
84
|
+
# "number": "Plural"
|
|
85
|
+
# }
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### 4. Direct Attribute Access
|
|
89
|
+
Access specific parts of the analysis directly.
|
|
90
|
+
```python
|
|
91
|
+
result = analyzer.analyze("olmalar")
|
|
92
|
+
|
|
93
|
+
print(f"Stem: {result.stem}") # Stem: olma
|
|
94
|
+
print(f"POS: {result.pos}") # POS: NOUN
|
|
95
|
+
print(f"Features: {result.features}") # Features: ['plural=1']
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Architecture Details
|
|
99
|
+
- **Input**: Character sequence (UTF-8).
|
|
100
|
+
- **Architecture**: 2-layer Bidirectional LSTM.
|
|
101
|
+
- **Tagging Strategy**: BIO (Beginning, Inside, Outside) sequence labeling.
|
|
102
|
+
- **Weights**: Pre-trained on a comprehensive CSE rule-engine dataset.
|
|
103
|
+
|
|
104
|
+
## License
|
|
105
|
+
MIT License. Free for academic and commercial use.
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# uzmorph-nn: Uzbek Neural Morphological Analyzer
|
|
2
|
+
|
|
3
|
+
**uzmorph-nn** is a high-accuracy word-level morphological analyzer for the Uzbek language based on a character-level Bidirectional LSTM (BiLSTM) architecture.
|
|
4
|
+
|
|
5
|
+
## Role & Performance
|
|
6
|
+
This package provides a robust foundation for Uzbek NLP tasks. It is specifically optimized for:
|
|
7
|
+
- **Agglutinative Processing**: Efficiently decomposes long chains of suffixes.
|
|
8
|
+
- **Phonological Awareness**: Handles stem changes (allomorphy) and vowel/consonant harmony correctly.
|
|
9
|
+
- **Rule-Augmented Deep Learning**: Built on 100,000+ rules from the Common Stem Expansion (CSE) framework.
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
```bash
|
|
13
|
+
pip install uzmorph-nn
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Quick Start & Usage Examples
|
|
17
|
+
|
|
18
|
+
### 1. Basic Analysis (String Output)
|
|
19
|
+
Great for quick debugging or readable logs.
|
|
20
|
+
```python
|
|
21
|
+
from uzmorph_nn import uzmorph_nn
|
|
22
|
+
|
|
23
|
+
# Initialize the analyzer
|
|
24
|
+
analyzer = uzmorph_nn()
|
|
25
|
+
|
|
26
|
+
# Analyze a word
|
|
27
|
+
result = analyzer.analyze("maktabimizda")
|
|
28
|
+
print(result)
|
|
29
|
+
|
|
30
|
+
# Output:
|
|
31
|
+
# Result: 'maktabimizda' -> Stem: maktab | POS: NOUN | Tags: [possession=1, cases=Locative, plural=1]
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### 2. Structured Data (Dictionary)
|
|
35
|
+
Ideal for integrating into other projects or data processing pipelines.
|
|
36
|
+
```python
|
|
37
|
+
result = analyzer.analyze("kitobim")
|
|
38
|
+
data = result.to_dict()
|
|
39
|
+
print(data)
|
|
40
|
+
|
|
41
|
+
# Output:
|
|
42
|
+
# {
|
|
43
|
+
# "word": "kitobim",
|
|
44
|
+
# "stem": "kitob",
|
|
45
|
+
# "pos": "NOUN",
|
|
46
|
+
# "possession": "1"
|
|
47
|
+
# }
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### 3. API Integration (JSON Output)
|
|
51
|
+
Useful for web services or sending data between different languages.
|
|
52
|
+
```python
|
|
53
|
+
result = analyzer.analyze("yozayapmiz")
|
|
54
|
+
print(result.to_json())
|
|
55
|
+
|
|
56
|
+
# Output:
|
|
57
|
+
# {
|
|
58
|
+
# "word": "yozayapmiz",
|
|
59
|
+
# "stem": "yoz",
|
|
60
|
+
# "pos": "VERB",
|
|
61
|
+
# "aspect": "Progressive",
|
|
62
|
+
# "person": "1",
|
|
63
|
+
# "number": "Plural"
|
|
64
|
+
# }
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### 4. Direct Attribute Access
|
|
68
|
+
Access specific parts of the analysis directly.
|
|
69
|
+
```python
|
|
70
|
+
result = analyzer.analyze("olmalar")
|
|
71
|
+
|
|
72
|
+
print(f"Stem: {result.stem}") # Stem: olma
|
|
73
|
+
print(f"POS: {result.pos}") # POS: NOUN
|
|
74
|
+
print(f"Features: {result.features}") # Features: ['plural=1']
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Architecture Details
|
|
78
|
+
- **Input**: Character sequence (UTF-8).
|
|
79
|
+
- **Architecture**: 2-layer Bidirectional LSTM.
|
|
80
|
+
- **Tagging Strategy**: BIO (Beginning, Inside, Outside) sequence labeling.
|
|
81
|
+
- **Weights**: Pre-trained on a comprehensive CSE rule-engine dataset.
|
|
82
|
+
|
|
83
|
+
## License
|
|
84
|
+
MIT License. Free for academic and commercial use.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
from setuptools import setup, find_packages
|
|
2
|
+
|
|
3
|
+
setup(
|
|
4
|
+
name="uzmorph-nn",
|
|
5
|
+
version="0.1.0",
|
|
6
|
+
author="Ulugbek Salaev",
|
|
7
|
+
description="Neural Network Uzbek Morphological Analyzer (BiLSTM, CSE)",
|
|
8
|
+
long_description=open("README.md", encoding="utf-8").read(),
|
|
9
|
+
long_description_content_type="text/markdown",
|
|
10
|
+
url="https://github.com/UlugbekSalaev/uzmorph_nn",
|
|
11
|
+
packages=find_packages(),
|
|
12
|
+
include_package_data=True,
|
|
13
|
+
package_data={
|
|
14
|
+
'uzmorph_nn': ['data/*.pth', 'data/*.json'],
|
|
15
|
+
},
|
|
16
|
+
install_requires=[
|
|
17
|
+
"torch",
|
|
18
|
+
],
|
|
19
|
+
classifiers=[
|
|
20
|
+
"Programming Language :: Python :: 3",
|
|
21
|
+
"License :: OSI Approved :: MIT License",
|
|
22
|
+
"Operating System :: OS Independent",
|
|
23
|
+
],
|
|
24
|
+
python_requires='>=3.7',
|
|
25
|
+
)
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
" ": 2,
|
|
3
|
+
"'": 3,
|
|
4
|
+
"(": 4,
|
|
5
|
+
")": 5,
|
|
6
|
+
"+": 6,
|
|
7
|
+
"-": 7,
|
|
8
|
+
".": 8,
|
|
9
|
+
"3": 9,
|
|
10
|
+
":": 10,
|
|
11
|
+
"A": 11,
|
|
12
|
+
"E": 12,
|
|
13
|
+
"F": 13,
|
|
14
|
+
"G": 14,
|
|
15
|
+
"L": 15,
|
|
16
|
+
"O": 16,
|
|
17
|
+
"Q": 17,
|
|
18
|
+
"S": 18,
|
|
19
|
+
"T": 19,
|
|
20
|
+
"U": 20,
|
|
21
|
+
"`": 21,
|
|
22
|
+
"a": 22,
|
|
23
|
+
"b": 23,
|
|
24
|
+
"c": 24,
|
|
25
|
+
"d": 25,
|
|
26
|
+
"e": 26,
|
|
27
|
+
"f": 27,
|
|
28
|
+
"g": 28,
|
|
29
|
+
"h": 29,
|
|
30
|
+
"i": 30,
|
|
31
|
+
"j": 31,
|
|
32
|
+
"k": 32,
|
|
33
|
+
"l": 33,
|
|
34
|
+
"m": 34,
|
|
35
|
+
"n": 35,
|
|
36
|
+
"o": 36,
|
|
37
|
+
"p": 37,
|
|
38
|
+
"q": 38,
|
|
39
|
+
"r": 39,
|
|
40
|
+
"s": 40,
|
|
41
|
+
"t": 41,
|
|
42
|
+
"u": 42,
|
|
43
|
+
"v": 43,
|
|
44
|
+
"x": 44,
|
|
45
|
+
"y": 45,
|
|
46
|
+
"z": 46,
|
|
47
|
+
"{": 47,
|
|
48
|
+
"}": 48,
|
|
49
|
+
"PAD": 0,
|
|
50
|
+
"UNK": 1
|
|
51
|
+
}
|
|
Binary file
|