sentor-ml 1.0.1__py3-none-any.whl → 1.0.2__py3-none-any.whl

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.
@@ -0,0 +1,221 @@
1
+ Metadata-Version: 2.4
2
+ Name: sentor-ml
3
+ Version: 1.0.2
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
+ - 🌍 Support for multiple languages
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
+ ## Get API key
51
+
52
+ ### Try with guest API key
53
+ Get a guest API key to try the API.
54
+
55
+ ```bash
56
+ curl -X 'POST' \
57
+ 'https://ml.sentor.app/api/auth/guest-access' \
58
+ -H 'accept: application/json' \
59
+ -d ''
60
+ ```
61
+
62
+ ### Work like a PRO
63
+
64
+ 1. Go to [Sentor ML API](https://ml.sentor.app)
65
+ 2. Subscribe to the Starter plan
66
+ 3. Get your API key
67
+
68
+ ## Usage
69
+
70
+ ### Basic Usage
71
+
72
+ ```python
73
+ from sentor import SentorClient
74
+
75
+ # Initialize the client
76
+ client = SentorClient('your-api-key')
77
+
78
+ # Analyze sentiment
79
+ input_data = [
80
+ {
81
+ "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.",
82
+ "doc_id": "0",
83
+ "entities": [
84
+ "Apple",
85
+ "Samsung",
86
+ "camera"
87
+ ]
88
+ },
89
+ {
90
+ "doc": "Apple's new iPhone is amazing!",
91
+ "doc_id": "1",
92
+ "entities": [
93
+ "Apple",
94
+ "iPhone"
95
+ ]
96
+ },
97
+ {
98
+ "doc": "Samsung's new phone is amazing!",
99
+ "doc_id": "2",
100
+ "entities": [
101
+ "Samsung",
102
+ "phone"
103
+ ]
104
+ }
105
+ ]
106
+ result = client.analyze(input_data)
107
+ print(result)
108
+ ```
109
+
110
+ ### Sample Output
111
+
112
+ ```json
113
+ {
114
+ "results": [
115
+ {
116
+ "doc_id": "0",
117
+ "predicted_class": 2,
118
+ "predicted_label": "positive",
119
+ "probabilities": {
120
+ "negative": 0.00007679959526285529,
121
+ "neutral": 0.0002924697764683515,
122
+ "positive": 0.9996306896209717
123
+ },
124
+ "details": [
125
+ {
126
+ "sentence_index": 0,
127
+ "sentence_text": "In the competitive landscape of consumer electronics, Apple and Samsung continue to lead the market with innovative products and strong brand loyalty.",
128
+ "predicted_class": 2,
129
+ "predicted_label": "positive",
130
+ "probabilities": {
131
+ "negative": 0.00009389198385179043,
132
+ "neutral": 0.00032428017584607005,
133
+ "positive": 0.9995818734169006
134
+ }
135
+ },
136
+ {
137
+ "sentence_index": 1,
138
+ "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.",
139
+ "predicted_class": 2,
140
+ "predicted_label": "positive",
141
+ "probabilities": {
142
+ "negative": 0.00005746580063714646,
143
+ "neutral": 0.00012963586777914315,
144
+ "positive": 0.99981290102005
145
+ }
146
+ },
147
+ {
148
+ "sentence_index": 2,
149
+ "sentence_text": "Both companies push the boundaries of technology, from cutting-edge chipsets to advanced camera systems, often setting industry trends that others follow.",
150
+ "predicted_class": 2,
151
+ "predicted_label": "positive",
152
+ "probabilities": {
153
+ "negative": 0.00006366783054545522,
154
+ "neutral": 0.00044553453335538507,
155
+ "positive": 0.9994907379150391
156
+ }
157
+ }
158
+ ]
159
+ },
160
+ {
161
+ "doc_id": "1",
162
+ "predicted_class": 2,
163
+ "predicted_label": "positive",
164
+ "probabilities": {
165
+ "negative": 0.00010637375817168504,
166
+ "neutral": 0.0002509312762413174,
167
+ "positive": 0.9996427297592163
168
+ },
169
+ "details": [
170
+ {
171
+ "sentence_index": 0,
172
+ "sentence_text": "Apple's new iPhone is amazing!",
173
+ "predicted_class": 2,
174
+ "predicted_label": "positive",
175
+ "probabilities": {
176
+ "negative": 0.00010637375817168504,
177
+ "neutral": 0.0002509312762413174,
178
+ "positive": 0.9996427297592163
179
+ }
180
+ }
181
+ ]
182
+ },
183
+ {
184
+ "doc_id": "2",
185
+ "predicted_class": 2,
186
+ "predicted_label": "positive",
187
+ "probabilities": {
188
+ "negative": 0.00010637375817168504,
189
+ "neutral": 0.0002509312762413174,
190
+ "positive": 0.9996427297592163
191
+ },
192
+ "details": [
193
+ {
194
+ "sentence_index": 0,
195
+ "sentence_text": "Samsung's new phone is amazing!",
196
+ "predicted_class": 2,
197
+ "predicted_label": "positive",
198
+ "probabilities": {
199
+ "negative": 0.00010637375817168504,
200
+ "neutral": 0.0002509312762413174,
201
+ "positive": 0.9996427297592163
202
+ }
203
+ }
204
+ ]
205
+ }
206
+ ]
207
+ }
208
+ ```
209
+
210
+ ## API Reference
211
+
212
+ Please refer to the [Sentor ML API Documentation](https://ml.sentor.app/docs/guide/) for more details.
213
+ You can also try the API in the [Sentor ML API Swagger Playground](https://ml.sentor.app/docs).
214
+
215
+ ## Contributing
216
+
217
+ Contributions are welcome! Please feel free to submit a Pull Request.
218
+
219
+ ## License
220
+
221
+ MIT License - see the [LICENSE](LICENSE) file for details.
@@ -3,8 +3,8 @@ sentor/client.py,sha256=6Sps6UFLmUaEiE69yY8C537OQTtLteGLROs3N6om5Ss,2519
3
3
  sentor/exceptions.py,sha256=MY5uFUJd_WBhCMc0zNxVvoasC1rME4Brqv82MwhDM7c,648
4
4
  tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  tests/test_client.py,sha256=kuhFtgwehMGqC0JKJfzAvqEl6UTvYo2nZDNa7YRF4rs,4101
6
- sentor_ml-1.0.1.dist-info/METADATA,sha256=qHfyKgqnYHhGe5eIJYyIocVQyB0wwM7umev1-jI30ns,3445
7
- sentor_ml-1.0.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
8
- sentor_ml-1.0.1.dist-info/entry_points.txt,sha256=iYoIGXM8AusRG36JhqnBREngOd0iDOYN0C8PpiHtgXE,46
9
- sentor_ml-1.0.1.dist-info/top_level.txt,sha256=nVfiI7y35XyGm5wyA94o24nDInXLiheycaaRtkR10ko,13
10
- sentor_ml-1.0.1.dist-info/RECORD,,
6
+ sentor_ml-1.0.2.dist-info/METADATA,sha256=pAP0tLMpvTQzfGc2osGYpG9lmAz-4u1SQ9IO-SZB4WA,6751
7
+ sentor_ml-1.0.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
8
+ sentor_ml-1.0.2.dist-info/entry_points.txt,sha256=iYoIGXM8AusRG36JhqnBREngOd0iDOYN0C8PpiHtgXE,46
9
+ sentor_ml-1.0.2.dist-info/top_level.txt,sha256=nVfiI7y35XyGm5wyA94o24nDInXLiheycaaRtkR10ko,13
10
+ sentor_ml-1.0.2.dist-info/RECORD,,
@@ -1,141 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: sentor-ml
3
- Version: 1.0.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
- - 🌍 Support for multiple languages
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
- ## Get API key
51
-
52
- ### Try with guest API key
53
- Get a guest API key to try the API.
54
-
55
- ```bash
56
- curl -X 'POST' \
57
- 'https://ml.sentor.app/api/auth/guest-access' \
58
- -H 'accept: application/json' \
59
- -d ''
60
- ```
61
-
62
- ### Work like a PRO
63
-
64
- 1. Go to [Sentor ML API](https://ml.sentor.app)
65
- 2. Subscribe to the Starter plan
66
- 3. Get your API key
67
-
68
- ## Usage
69
-
70
- ### Basic Usage
71
-
72
- ```python
73
- from sentor import SentorClient
74
-
75
- # Initialize the client
76
- client = SentorClient('your-api-key')
77
-
78
- # Analyze sentiment
79
- input_data = [
80
- {
81
- "doc": "Apple's new iPhone is amazing!",
82
- "doc_id": "1",
83
- "entities": [
84
- "Apple",
85
- "iPhone"
86
- ]
87
- },
88
- {
89
- "doc": "Samsung's new phone is amazing!",
90
- "doc_id": "2",
91
- "entities": [
92
- "Samsung",
93
- "phone"
94
- ]
95
- }
96
- ]
97
- result = client.analyze(input_data)
98
- print(result)
99
- ```
100
-
101
- ### Sample Output
102
-
103
- ```json
104
- {
105
- "results": [
106
- {
107
- "doc_id": "1",
108
- "predicted_class": 2,
109
- "predicted_label": "positive",
110
- "probabilities": {
111
- "negative": 0.00010637386003509164,
112
- "neutral": 0.0002509312762413174,
113
- "positive": 0.9996427297592163
114
- }
115
- },
116
- {
117
- "doc_id": "2",
118
- "predicted_class": 2,
119
- "predicted_label": "positive",
120
- "probabilities": {
121
- "negative": 0.00010637386003509164,
122
- "neutral": 0.0002509312762413174,
123
- "positive": 0.9996427297592163
124
- }
125
- }
126
- ]
127
- }
128
- ```
129
-
130
- ## API Reference
131
-
132
- Please refer to the [Sentor ML API Documentation](https://ml.sentor.app/docs/guide/) for more details.
133
- You can also try the API in the [Sentor ML API Swagger Playground](https://ml.sentor.app/docs).
134
-
135
- ## Contributing
136
-
137
- Contributions are welcome! Please feel free to submit a Pull Request.
138
-
139
- ## License
140
-
141
- MIT License - see the [LICENSE](LICENSE) file for details.