sentor-ml 1.0.1__tar.gz → 1.0.2__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.0.2/PKG-INFO +221 -0
- sentor_ml-1.0.2/README.md +191 -0
- sentor_ml-1.0.2/sentor_ml.egg-info/PKG-INFO +221 -0
- {sentor_ml-1.0.1 → sentor_ml-1.0.2}/setup.py +1 -1
- sentor_ml-1.0.1/PKG-INFO +0 -141
- sentor_ml-1.0.1/README.md +0 -111
- sentor_ml-1.0.1/sentor_ml.egg-info/PKG-INFO +0 -141
- {sentor_ml-1.0.1 → sentor_ml-1.0.2}/sentor/__init__.py +0 -0
- {sentor_ml-1.0.1 → sentor_ml-1.0.2}/sentor/client.py +0 -0
- {sentor_ml-1.0.1 → sentor_ml-1.0.2}/sentor/exceptions.py +0 -0
- {sentor_ml-1.0.1 → sentor_ml-1.0.2}/sentor_ml.egg-info/SOURCES.txt +0 -0
- {sentor_ml-1.0.1 → sentor_ml-1.0.2}/sentor_ml.egg-info/dependency_links.txt +0 -0
- {sentor_ml-1.0.1 → sentor_ml-1.0.2}/sentor_ml.egg-info/entry_points.txt +0 -0
- {sentor_ml-1.0.1 → sentor_ml-1.0.2}/sentor_ml.egg-info/requires.txt +0 -0
- {sentor_ml-1.0.1 → sentor_ml-1.0.2}/sentor_ml.egg-info/top_level.txt +0 -0
- {sentor_ml-1.0.1 → sentor_ml-1.0.2}/setup.cfg +0 -0
- {sentor_ml-1.0.1 → sentor_ml-1.0.2}/tests/__init__.py +0 -0
- {sentor_ml-1.0.1 → sentor_ml-1.0.2}/tests/test_client.py +0 -0
sentor_ml-1.0.2/PKG-INFO
ADDED
|
@@ -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.
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
# Sentor Python SDK
|
|
2
|
+
|
|
3
|
+
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.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- 🚀 Python 3.7+ support
|
|
8
|
+
- ⚡ Simple and intuitive API
|
|
9
|
+
- 🌍 Support for multiple languages
|
|
10
|
+
- 📦 Batch processing capabilities
|
|
11
|
+
- 🛡️ Comprehensive error handling
|
|
12
|
+
- 🔄 Real-time sentiment analysis
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
pip install sentor-ml
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Get API key
|
|
21
|
+
|
|
22
|
+
### Try with guest API key
|
|
23
|
+
Get a guest API key to try the API.
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
curl -X 'POST' \
|
|
27
|
+
'https://ml.sentor.app/api/auth/guest-access' \
|
|
28
|
+
-H 'accept: application/json' \
|
|
29
|
+
-d ''
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Work like a PRO
|
|
33
|
+
|
|
34
|
+
1. Go to [Sentor ML API](https://ml.sentor.app)
|
|
35
|
+
2. Subscribe to the Starter plan
|
|
36
|
+
3. Get your API key
|
|
37
|
+
|
|
38
|
+
## Usage
|
|
39
|
+
|
|
40
|
+
### Basic Usage
|
|
41
|
+
|
|
42
|
+
```python
|
|
43
|
+
from sentor import SentorClient
|
|
44
|
+
|
|
45
|
+
# Initialize the client
|
|
46
|
+
client = SentorClient('your-api-key')
|
|
47
|
+
|
|
48
|
+
# Analyze sentiment
|
|
49
|
+
input_data = [
|
|
50
|
+
{
|
|
51
|
+
"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.",
|
|
52
|
+
"doc_id": "0",
|
|
53
|
+
"entities": [
|
|
54
|
+
"Apple",
|
|
55
|
+
"Samsung",
|
|
56
|
+
"camera"
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"doc": "Apple's new iPhone is amazing!",
|
|
61
|
+
"doc_id": "1",
|
|
62
|
+
"entities": [
|
|
63
|
+
"Apple",
|
|
64
|
+
"iPhone"
|
|
65
|
+
]
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"doc": "Samsung's new phone is amazing!",
|
|
69
|
+
"doc_id": "2",
|
|
70
|
+
"entities": [
|
|
71
|
+
"Samsung",
|
|
72
|
+
"phone"
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
result = client.analyze(input_data)
|
|
77
|
+
print(result)
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Sample Output
|
|
81
|
+
|
|
82
|
+
```json
|
|
83
|
+
{
|
|
84
|
+
"results": [
|
|
85
|
+
{
|
|
86
|
+
"doc_id": "0",
|
|
87
|
+
"predicted_class": 2,
|
|
88
|
+
"predicted_label": "positive",
|
|
89
|
+
"probabilities": {
|
|
90
|
+
"negative": 0.00007679959526285529,
|
|
91
|
+
"neutral": 0.0002924697764683515,
|
|
92
|
+
"positive": 0.9996306896209717
|
|
93
|
+
},
|
|
94
|
+
"details": [
|
|
95
|
+
{
|
|
96
|
+
"sentence_index": 0,
|
|
97
|
+
"sentence_text": "In the competitive landscape of consumer electronics, Apple and Samsung continue to lead the market with innovative products and strong brand loyalty.",
|
|
98
|
+
"predicted_class": 2,
|
|
99
|
+
"predicted_label": "positive",
|
|
100
|
+
"probabilities": {
|
|
101
|
+
"negative": 0.00009389198385179043,
|
|
102
|
+
"neutral": 0.00032428017584607005,
|
|
103
|
+
"positive": 0.9995818734169006
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"sentence_index": 1,
|
|
108
|
+
"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.",
|
|
109
|
+
"predicted_class": 2,
|
|
110
|
+
"predicted_label": "positive",
|
|
111
|
+
"probabilities": {
|
|
112
|
+
"negative": 0.00005746580063714646,
|
|
113
|
+
"neutral": 0.00012963586777914315,
|
|
114
|
+
"positive": 0.99981290102005
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"sentence_index": 2,
|
|
119
|
+
"sentence_text": "Both companies push the boundaries of technology, from cutting-edge chipsets to advanced camera systems, often setting industry trends that others follow.",
|
|
120
|
+
"predicted_class": 2,
|
|
121
|
+
"predicted_label": "positive",
|
|
122
|
+
"probabilities": {
|
|
123
|
+
"negative": 0.00006366783054545522,
|
|
124
|
+
"neutral": 0.00044553453335538507,
|
|
125
|
+
"positive": 0.9994907379150391
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
]
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"doc_id": "1",
|
|
132
|
+
"predicted_class": 2,
|
|
133
|
+
"predicted_label": "positive",
|
|
134
|
+
"probabilities": {
|
|
135
|
+
"negative": 0.00010637375817168504,
|
|
136
|
+
"neutral": 0.0002509312762413174,
|
|
137
|
+
"positive": 0.9996427297592163
|
|
138
|
+
},
|
|
139
|
+
"details": [
|
|
140
|
+
{
|
|
141
|
+
"sentence_index": 0,
|
|
142
|
+
"sentence_text": "Apple's new iPhone is amazing!",
|
|
143
|
+
"predicted_class": 2,
|
|
144
|
+
"predicted_label": "positive",
|
|
145
|
+
"probabilities": {
|
|
146
|
+
"negative": 0.00010637375817168504,
|
|
147
|
+
"neutral": 0.0002509312762413174,
|
|
148
|
+
"positive": 0.9996427297592163
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
]
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"doc_id": "2",
|
|
155
|
+
"predicted_class": 2,
|
|
156
|
+
"predicted_label": "positive",
|
|
157
|
+
"probabilities": {
|
|
158
|
+
"negative": 0.00010637375817168504,
|
|
159
|
+
"neutral": 0.0002509312762413174,
|
|
160
|
+
"positive": 0.9996427297592163
|
|
161
|
+
},
|
|
162
|
+
"details": [
|
|
163
|
+
{
|
|
164
|
+
"sentence_index": 0,
|
|
165
|
+
"sentence_text": "Samsung's new phone is amazing!",
|
|
166
|
+
"predicted_class": 2,
|
|
167
|
+
"predicted_label": "positive",
|
|
168
|
+
"probabilities": {
|
|
169
|
+
"negative": 0.00010637375817168504,
|
|
170
|
+
"neutral": 0.0002509312762413174,
|
|
171
|
+
"positive": 0.9996427297592163
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
]
|
|
175
|
+
}
|
|
176
|
+
]
|
|
177
|
+
}
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
## API Reference
|
|
181
|
+
|
|
182
|
+
Please refer to the [Sentor ML API Documentation](https://ml.sentor.app/docs/guide/) for more details.
|
|
183
|
+
You can also try the API in the [Sentor ML API Swagger Playground](https://ml.sentor.app/docs).
|
|
184
|
+
|
|
185
|
+
## Contributing
|
|
186
|
+
|
|
187
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
188
|
+
|
|
189
|
+
## License
|
|
190
|
+
|
|
191
|
+
MIT License - see the [LICENSE](LICENSE) file for details.
|
|
@@ -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.
|
|
@@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
|
|
|
5
5
|
|
|
6
6
|
setup(
|
|
7
7
|
name="sentor-ml",
|
|
8
|
-
version="1.0.
|
|
8
|
+
version="1.0.2",
|
|
9
9
|
author="NIKX Technologies",
|
|
10
10
|
author_email="sentor@nikx.one",
|
|
11
11
|
description="A Python SDK for interacting with the Sentor ML API for sentiment analysis",
|
sentor_ml-1.0.1/PKG-INFO
DELETED
|
@@ -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.
|
sentor_ml-1.0.1/README.md
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
# Sentor Python SDK
|
|
2
|
-
|
|
3
|
-
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.
|
|
4
|
-
|
|
5
|
-
## Features
|
|
6
|
-
|
|
7
|
-
- 🚀 Python 3.7+ support
|
|
8
|
-
- ⚡ Simple and intuitive API
|
|
9
|
-
- 🌍 Support for multiple languages
|
|
10
|
-
- 📦 Batch processing capabilities
|
|
11
|
-
- 🛡️ Comprehensive error handling
|
|
12
|
-
- 🔄 Real-time sentiment analysis
|
|
13
|
-
|
|
14
|
-
## Installation
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
pip install sentor-ml
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
## Get API key
|
|
21
|
-
|
|
22
|
-
### Try with guest API key
|
|
23
|
-
Get a guest API key to try the API.
|
|
24
|
-
|
|
25
|
-
```bash
|
|
26
|
-
curl -X 'POST' \
|
|
27
|
-
'https://ml.sentor.app/api/auth/guest-access' \
|
|
28
|
-
-H 'accept: application/json' \
|
|
29
|
-
-d ''
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
### Work like a PRO
|
|
33
|
-
|
|
34
|
-
1. Go to [Sentor ML API](https://ml.sentor.app)
|
|
35
|
-
2. Subscribe to the Starter plan
|
|
36
|
-
3. Get your API key
|
|
37
|
-
|
|
38
|
-
## Usage
|
|
39
|
-
|
|
40
|
-
### Basic Usage
|
|
41
|
-
|
|
42
|
-
```python
|
|
43
|
-
from sentor import SentorClient
|
|
44
|
-
|
|
45
|
-
# Initialize the client
|
|
46
|
-
client = SentorClient('your-api-key')
|
|
47
|
-
|
|
48
|
-
# Analyze sentiment
|
|
49
|
-
input_data = [
|
|
50
|
-
{
|
|
51
|
-
"doc": "Apple's new iPhone is amazing!",
|
|
52
|
-
"doc_id": "1",
|
|
53
|
-
"entities": [
|
|
54
|
-
"Apple",
|
|
55
|
-
"iPhone"
|
|
56
|
-
]
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
"doc": "Samsung's new phone is amazing!",
|
|
60
|
-
"doc_id": "2",
|
|
61
|
-
"entities": [
|
|
62
|
-
"Samsung",
|
|
63
|
-
"phone"
|
|
64
|
-
]
|
|
65
|
-
}
|
|
66
|
-
]
|
|
67
|
-
result = client.analyze(input_data)
|
|
68
|
-
print(result)
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
### Sample Output
|
|
72
|
-
|
|
73
|
-
```json
|
|
74
|
-
{
|
|
75
|
-
"results": [
|
|
76
|
-
{
|
|
77
|
-
"doc_id": "1",
|
|
78
|
-
"predicted_class": 2,
|
|
79
|
-
"predicted_label": "positive",
|
|
80
|
-
"probabilities": {
|
|
81
|
-
"negative": 0.00010637386003509164,
|
|
82
|
-
"neutral": 0.0002509312762413174,
|
|
83
|
-
"positive": 0.9996427297592163
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
"doc_id": "2",
|
|
88
|
-
"predicted_class": 2,
|
|
89
|
-
"predicted_label": "positive",
|
|
90
|
-
"probabilities": {
|
|
91
|
-
"negative": 0.00010637386003509164,
|
|
92
|
-
"neutral": 0.0002509312762413174,
|
|
93
|
-
"positive": 0.9996427297592163
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
]
|
|
97
|
-
}
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
## API Reference
|
|
101
|
-
|
|
102
|
-
Please refer to the [Sentor ML API Documentation](https://ml.sentor.app/docs/guide/) for more details.
|
|
103
|
-
You can also try the API in the [Sentor ML API Swagger Playground](https://ml.sentor.app/docs).
|
|
104
|
-
|
|
105
|
-
## Contributing
|
|
106
|
-
|
|
107
|
-
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
108
|
-
|
|
109
|
-
## License
|
|
110
|
-
|
|
111
|
-
MIT License - see the [LICENSE](LICENSE) file for details.
|
|
@@ -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.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|