sentor-ml 1.1.0__tar.gz → 1.4.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.
- {sentor_ml-1.1.0 → sentor_ml-1.4.0}/PKG-INFO +232 -209
- {sentor_ml-1.1.0 → sentor_ml-1.4.0}/README.md +201 -178
- {sentor_ml-1.1.0 → sentor_ml-1.4.0}/sentor/__init__.py +3 -3
- {sentor_ml-1.1.0 → sentor_ml-1.4.0}/sentor/client.py +96 -86
- {sentor_ml-1.1.0 → sentor_ml-1.4.0}/sentor/exceptions.py +21 -21
- {sentor_ml-1.1.0 → sentor_ml-1.4.0}/sentor_ml.egg-info/PKG-INFO +232 -209
- {sentor_ml-1.1.0 → sentor_ml-1.4.0}/setup.cfg +4 -4
- {sentor_ml-1.1.0 → sentor_ml-1.4.0}/setup.py +37 -37
- {sentor_ml-1.1.0 → sentor_ml-1.4.0}/tests/test_client.py +192 -132
- {sentor_ml-1.1.0 → sentor_ml-1.4.0}/sentor_ml.egg-info/SOURCES.txt +0 -0
- {sentor_ml-1.1.0 → sentor_ml-1.4.0}/sentor_ml.egg-info/dependency_links.txt +0 -0
- {sentor_ml-1.1.0 → sentor_ml-1.4.0}/sentor_ml.egg-info/entry_points.txt +0 -0
- {sentor_ml-1.1.0 → sentor_ml-1.4.0}/sentor_ml.egg-info/requires.txt +0 -0
- {sentor_ml-1.1.0 → sentor_ml-1.4.0}/sentor_ml.egg-info/top_level.txt +0 -0
- {sentor_ml-1.1.0 → sentor_ml-1.4.0}/tests/__init__.py +0 -0
|
@@ -1,209 +1,232 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: sentor-ml
|
|
3
|
-
Version: 1.
|
|
4
|
-
Summary: A Python SDK for interacting with the Sentor ML API for sentiment analysis
|
|
5
|
-
Home-page: https://github.com/NIKX-Tech/sentor-ml-python-sdk
|
|
6
|
-
Author: NIKX Technologies
|
|
7
|
-
Author-email: sentor@nikx.one
|
|
8
|
-
Classifier: Development Status :: 4 - Beta
|
|
9
|
-
Classifier: Intended Audience :: Developers
|
|
10
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
-
Classifier: Operating System :: OS Independent
|
|
12
|
-
Classifier: Programming Language :: Python :: 3
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
-
Requires-Python: >=3.7
|
|
19
|
-
Description-Content-Type: text/markdown
|
|
20
|
-
Requires-Dist: requests>=2.28.0
|
|
21
|
-
Dynamic: author
|
|
22
|
-
Dynamic: author-email
|
|
23
|
-
Dynamic: classifier
|
|
24
|
-
Dynamic: description
|
|
25
|
-
Dynamic: description-content-type
|
|
26
|
-
Dynamic: home-page
|
|
27
|
-
Dynamic: requires-dist
|
|
28
|
-
Dynamic: requires-python
|
|
29
|
-
Dynamic: summary
|
|
30
|
-
|
|
31
|
-
# Sentor Python SDK
|
|
32
|
-
|
|
33
|
-
A Python SDK for interacting with the Sentor ML API for sentiment analysis. This SDK provides a simple and intuitive interface for sentiment analysis operations.
|
|
34
|
-
|
|
35
|
-
## Features
|
|
36
|
-
|
|
37
|
-
- 🚀 Python 3.7+ support
|
|
38
|
-
- ⚡ Simple and intuitive API
|
|
39
|
-
- 🌍
|
|
40
|
-
- 📦 Batch processing capabilities
|
|
41
|
-
- 🛡️ Comprehensive error handling
|
|
42
|
-
- 🔄 Real-time sentiment analysis
|
|
43
|
-
|
|
44
|
-
## Installation
|
|
45
|
-
|
|
46
|
-
```bash
|
|
47
|
-
pip install sentor-ml
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
### Work like a PRO
|
|
51
|
-
|
|
52
|
-
1. Go to [Sentor ML API](https://sentor.app/api)
|
|
53
|
-
2. Subscribe to the Starter plan
|
|
54
|
-
3. Get your API key
|
|
55
|
-
|
|
56
|
-
## Usage
|
|
57
|
-
|
|
58
|
-
### Basic Usage
|
|
59
|
-
|
|
60
|
-
```python
|
|
61
|
-
from sentor import SentorClient
|
|
62
|
-
|
|
63
|
-
# Initialize the client
|
|
64
|
-
client = SentorClient('your-api-key')
|
|
65
|
-
|
|
66
|
-
#
|
|
67
|
-
input_data = [
|
|
68
|
-
{
|
|
69
|
-
"doc": "In the competitive landscape of consumer electronics, Apple and Samsung continue to lead the market with innovative products and strong brand loyalty. While Apple focuses on a tightly integrated ecosystem with devices like the iPhone, iPad, and Mac, Samsung excels in offering a wide range of options across various price points, especially in its Galaxy smartphone lineup. Both companies push the boundaries of technology, from cutting-edge chipsets to advanced camera systems, often setting industry trends that others follow.",
|
|
70
|
-
"doc_id": "0",
|
|
71
|
-
"entities": [
|
|
72
|
-
"Apple",
|
|
73
|
-
"Samsung",
|
|
74
|
-
"camera"
|
|
75
|
-
]
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
"doc": "Apple's new iPhone is amazing!",
|
|
79
|
-
"doc_id": "1",
|
|
80
|
-
"entities": [
|
|
81
|
-
"Apple",
|
|
82
|
-
"iPhone"
|
|
83
|
-
]
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
"doc": "Samsung's new phone is amazing!",
|
|
87
|
-
"doc_id": "2",
|
|
88
|
-
"entities": [
|
|
89
|
-
"Samsung",
|
|
90
|
-
"phone"
|
|
91
|
-
]
|
|
92
|
-
}
|
|
93
|
-
]
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
"
|
|
138
|
-
"
|
|
139
|
-
"
|
|
140
|
-
"
|
|
141
|
-
|
|
142
|
-
"
|
|
143
|
-
"
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
{
|
|
159
|
-
"sentence_index":
|
|
160
|
-
"sentence_text": "
|
|
161
|
-
"predicted_class": 2,
|
|
162
|
-
"predicted_label": "positive",
|
|
163
|
-
"probabilities": {
|
|
164
|
-
"negative": 0.
|
|
165
|
-
"neutral": 0.
|
|
166
|
-
"positive": 0.
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
]
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
"doc_id": "
|
|
173
|
-
"predicted_class": 2,
|
|
174
|
-
"predicted_label": "positive",
|
|
175
|
-
"probabilities": {
|
|
176
|
-
"negative": 0.00010637375817168504,
|
|
177
|
-
"neutral": 0.0002509312762413174,
|
|
178
|
-
"positive": 0.9996427297592163
|
|
179
|
-
},
|
|
180
|
-
"details": [
|
|
181
|
-
{
|
|
182
|
-
"sentence_index": 0,
|
|
183
|
-
"sentence_text": "
|
|
184
|
-
"predicted_class": 2,
|
|
185
|
-
"predicted_label": "positive",
|
|
186
|
-
"probabilities": {
|
|
187
|
-
"negative": 0.00010637375817168504,
|
|
188
|
-
"neutral": 0.0002509312762413174,
|
|
189
|
-
"positive": 0.9996427297592163
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
]
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: sentor-ml
|
|
3
|
+
Version: 1.4.0
|
|
4
|
+
Summary: A Python SDK for interacting with the Sentor ML API for sentiment analysis
|
|
5
|
+
Home-page: https://github.com/NIKX-Tech/sentor-ml-python-sdk
|
|
6
|
+
Author: NIKX Technologies
|
|
7
|
+
Author-email: sentor@nikx.one
|
|
8
|
+
Classifier: Development Status :: 4 - Beta
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Requires-Python: >=3.7
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
Requires-Dist: requests>=2.28.0
|
|
21
|
+
Dynamic: author
|
|
22
|
+
Dynamic: author-email
|
|
23
|
+
Dynamic: classifier
|
|
24
|
+
Dynamic: description
|
|
25
|
+
Dynamic: description-content-type
|
|
26
|
+
Dynamic: home-page
|
|
27
|
+
Dynamic: requires-dist
|
|
28
|
+
Dynamic: requires-python
|
|
29
|
+
Dynamic: summary
|
|
30
|
+
|
|
31
|
+
# Sentor Python SDK
|
|
32
|
+
|
|
33
|
+
A Python SDK for interacting with the Sentor ML API for sentiment analysis. This SDK provides a simple and intuitive interface for sentiment analysis operations.
|
|
34
|
+
|
|
35
|
+
## Features
|
|
36
|
+
|
|
37
|
+
- 🚀 Python 3.7+ support
|
|
38
|
+
- ⚡ Simple and intuitive API
|
|
39
|
+
- 🌍 Multi-language support (English and Dutch)
|
|
40
|
+
- 📦 Batch processing capabilities
|
|
41
|
+
- 🛡️ Comprehensive error handling
|
|
42
|
+
- 🔄 Real-time sentiment analysis
|
|
43
|
+
|
|
44
|
+
## Installation
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
pip install sentor-ml
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Work like a PRO
|
|
51
|
+
|
|
52
|
+
1. Go to [Sentor ML API](https://sentor.app/api)
|
|
53
|
+
2. Subscribe to the Starter plan
|
|
54
|
+
3. Get your API key
|
|
55
|
+
|
|
56
|
+
## Usage
|
|
57
|
+
|
|
58
|
+
### Basic Usage
|
|
59
|
+
|
|
60
|
+
```python
|
|
61
|
+
from sentor import SentorClient
|
|
62
|
+
|
|
63
|
+
# Initialize the client
|
|
64
|
+
client = SentorClient('your-api-key')
|
|
65
|
+
|
|
66
|
+
# Predict sentiment
|
|
67
|
+
input_data = [
|
|
68
|
+
{
|
|
69
|
+
"doc": "In the competitive landscape of consumer electronics, Apple and Samsung continue to lead the market with innovative products and strong brand loyalty. While Apple focuses on a tightly integrated ecosystem with devices like the iPhone, iPad, and Mac, Samsung excels in offering a wide range of options across various price points, especially in its Galaxy smartphone lineup. Both companies push the boundaries of technology, from cutting-edge chipsets to advanced camera systems, often setting industry trends that others follow.",
|
|
70
|
+
"doc_id": "0",
|
|
71
|
+
"entities": [
|
|
72
|
+
"Apple",
|
|
73
|
+
"Samsung",
|
|
74
|
+
"camera"
|
|
75
|
+
]
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"doc": "Apple's new iPhone is amazing!",
|
|
79
|
+
"doc_id": "1",
|
|
80
|
+
"entities": [
|
|
81
|
+
"Apple",
|
|
82
|
+
"iPhone"
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"doc": "Samsung's new phone is amazing!",
|
|
87
|
+
"doc_id": "2",
|
|
88
|
+
"entities": [
|
|
89
|
+
"Samsung",
|
|
90
|
+
"phone"
|
|
91
|
+
]
|
|
92
|
+
}
|
|
93
|
+
]
|
|
94
|
+
# Predict with default language (English)
|
|
95
|
+
result = client.predict(input_data)
|
|
96
|
+
print(result)
|
|
97
|
+
|
|
98
|
+
# Predict with Dutch language
|
|
99
|
+
result_nl = client.predict(input_data, language="nl")
|
|
100
|
+
print(result_nl)
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Language Support
|
|
104
|
+
|
|
105
|
+
The SDK supports multi-language sentiment analysis with the following options:
|
|
106
|
+
|
|
107
|
+
- `"en"` (default): English language prediction
|
|
108
|
+
- `"nl"`: Dutch language prediction
|
|
109
|
+
|
|
110
|
+
```python
|
|
111
|
+
# Default English prediction
|
|
112
|
+
result_en = client.predict(documents)
|
|
113
|
+
|
|
114
|
+
# Explicitly specify English
|
|
115
|
+
result_en = client.predict(documents, language="en")
|
|
116
|
+
|
|
117
|
+
# Dutch language prediction
|
|
118
|
+
result_nl = client.predict(documents, language="nl")
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Sample Output
|
|
122
|
+
|
|
123
|
+
```json
|
|
124
|
+
{
|
|
125
|
+
"results": [
|
|
126
|
+
{
|
|
127
|
+
"doc_id": "0",
|
|
128
|
+
"predicted_class": 2,
|
|
129
|
+
"predicted_label": "positive",
|
|
130
|
+
"probabilities": {
|
|
131
|
+
"negative": 0.00007679959526285529,
|
|
132
|
+
"neutral": 0.0002924697764683515,
|
|
133
|
+
"positive": 0.9996306896209717
|
|
134
|
+
},
|
|
135
|
+
"details": [
|
|
136
|
+
{
|
|
137
|
+
"sentence_index": 0,
|
|
138
|
+
"sentence_text": "In the competitive landscape of consumer electronics, Apple and Samsung continue to lead the market with innovative products and strong brand loyalty.",
|
|
139
|
+
"predicted_class": 2,
|
|
140
|
+
"predicted_label": "positive",
|
|
141
|
+
"probabilities": {
|
|
142
|
+
"negative": 0.00009389198385179043,
|
|
143
|
+
"neutral": 0.00032428017584607005,
|
|
144
|
+
"positive": 0.9995818734169006
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"sentence_index": 1,
|
|
149
|
+
"sentence_text": "While Apple focuses on a tightly integrated ecosystem with devices like the iPhone, iPad, and Mac, Samsung excels in offering a wide range of options across various price points, especially in its Galaxy smartphone lineup.",
|
|
150
|
+
"predicted_class": 2,
|
|
151
|
+
"predicted_label": "positive",
|
|
152
|
+
"probabilities": {
|
|
153
|
+
"negative": 0.00005746580063714646,
|
|
154
|
+
"neutral": 0.00012963586777914315,
|
|
155
|
+
"positive": 0.99981290102005
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"sentence_index": 2,
|
|
160
|
+
"sentence_text": "Both companies push the boundaries of technology, from cutting-edge chipsets to advanced camera systems, often setting industry trends that others follow.",
|
|
161
|
+
"predicted_class": 2,
|
|
162
|
+
"predicted_label": "positive",
|
|
163
|
+
"probabilities": {
|
|
164
|
+
"negative": 0.00006366783054545522,
|
|
165
|
+
"neutral": 0.00044553453335538507,
|
|
166
|
+
"positive": 0.9994907379150391
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
]
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"doc_id": "1",
|
|
173
|
+
"predicted_class": 2,
|
|
174
|
+
"predicted_label": "positive",
|
|
175
|
+
"probabilities": {
|
|
176
|
+
"negative": 0.00010637375817168504,
|
|
177
|
+
"neutral": 0.0002509312762413174,
|
|
178
|
+
"positive": 0.9996427297592163
|
|
179
|
+
},
|
|
180
|
+
"details": [
|
|
181
|
+
{
|
|
182
|
+
"sentence_index": 0,
|
|
183
|
+
"sentence_text": "Apple's new iPhone is amazing!",
|
|
184
|
+
"predicted_class": 2,
|
|
185
|
+
"predicted_label": "positive",
|
|
186
|
+
"probabilities": {
|
|
187
|
+
"negative": 0.00010637375817168504,
|
|
188
|
+
"neutral": 0.0002509312762413174,
|
|
189
|
+
"positive": 0.9996427297592163
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
]
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"doc_id": "2",
|
|
196
|
+
"predicted_class": 2,
|
|
197
|
+
"predicted_label": "positive",
|
|
198
|
+
"probabilities": {
|
|
199
|
+
"negative": 0.00010637375817168504,
|
|
200
|
+
"neutral": 0.0002509312762413174,
|
|
201
|
+
"positive": 0.9996427297592163
|
|
202
|
+
},
|
|
203
|
+
"details": [
|
|
204
|
+
{
|
|
205
|
+
"sentence_index": 0,
|
|
206
|
+
"sentence_text": "Samsung's new phone is amazing!",
|
|
207
|
+
"predicted_class": 2,
|
|
208
|
+
"predicted_label": "positive",
|
|
209
|
+
"probabilities": {
|
|
210
|
+
"negative": 0.00010637375817168504,
|
|
211
|
+
"neutral": 0.0002509312762413174,
|
|
212
|
+
"positive": 0.9996427297592163
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
]
|
|
216
|
+
}
|
|
217
|
+
]
|
|
218
|
+
}
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
## API Reference
|
|
222
|
+
|
|
223
|
+
Please refer to the [Sentor ML API Documentation](https://sentor.app/docs) for more details.
|
|
224
|
+
You can also try the API in the [Sentor ML API Swagger Playground](https://sentor.app/docs).
|
|
225
|
+
|
|
226
|
+
## Contributing
|
|
227
|
+
|
|
228
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
229
|
+
|
|
230
|
+
## License
|
|
231
|
+
|
|
232
|
+
MIT License - see the [LICENSE](LICENSE) file for details.
|