sentor-ml 1.0.1__tar.gz → 1.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.
@@ -0,0 +1,209 @@
1
+ Metadata-Version: 2.4
2
+ Name: sentor-ml
3
+ Version: 1.1.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
+ - 🌍 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
+ ### 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
+ # Analyze 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
+ result = client.analyze(input_data)
95
+ print(result)
96
+ ```
97
+
98
+ ### Sample Output
99
+
100
+ ```json
101
+ {
102
+ "results": [
103
+ {
104
+ "doc_id": "0",
105
+ "predicted_class": 2,
106
+ "predicted_label": "positive",
107
+ "probabilities": {
108
+ "negative": 0.00007679959526285529,
109
+ "neutral": 0.0002924697764683515,
110
+ "positive": 0.9996306896209717
111
+ },
112
+ "details": [
113
+ {
114
+ "sentence_index": 0,
115
+ "sentence_text": "In the competitive landscape of consumer electronics, Apple and Samsung continue to lead the market with innovative products and strong brand loyalty.",
116
+ "predicted_class": 2,
117
+ "predicted_label": "positive",
118
+ "probabilities": {
119
+ "negative": 0.00009389198385179043,
120
+ "neutral": 0.00032428017584607005,
121
+ "positive": 0.9995818734169006
122
+ }
123
+ },
124
+ {
125
+ "sentence_index": 1,
126
+ "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.",
127
+ "predicted_class": 2,
128
+ "predicted_label": "positive",
129
+ "probabilities": {
130
+ "negative": 0.00005746580063714646,
131
+ "neutral": 0.00012963586777914315,
132
+ "positive": 0.99981290102005
133
+ }
134
+ },
135
+ {
136
+ "sentence_index": 2,
137
+ "sentence_text": "Both companies push the boundaries of technology, from cutting-edge chipsets to advanced camera systems, often setting industry trends that others follow.",
138
+ "predicted_class": 2,
139
+ "predicted_label": "positive",
140
+ "probabilities": {
141
+ "negative": 0.00006366783054545522,
142
+ "neutral": 0.00044553453335538507,
143
+ "positive": 0.9994907379150391
144
+ }
145
+ }
146
+ ]
147
+ },
148
+ {
149
+ "doc_id": "1",
150
+ "predicted_class": 2,
151
+ "predicted_label": "positive",
152
+ "probabilities": {
153
+ "negative": 0.00010637375817168504,
154
+ "neutral": 0.0002509312762413174,
155
+ "positive": 0.9996427297592163
156
+ },
157
+ "details": [
158
+ {
159
+ "sentence_index": 0,
160
+ "sentence_text": "Apple's new iPhone is amazing!",
161
+ "predicted_class": 2,
162
+ "predicted_label": "positive",
163
+ "probabilities": {
164
+ "negative": 0.00010637375817168504,
165
+ "neutral": 0.0002509312762413174,
166
+ "positive": 0.9996427297592163
167
+ }
168
+ }
169
+ ]
170
+ },
171
+ {
172
+ "doc_id": "2",
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": "Samsung's new phone 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
+ }
196
+ ```
197
+
198
+ ## API Reference
199
+
200
+ Please refer to the [Sentor ML API Documentation](https://sentor.app/docs) for more details.
201
+ You can also try the API in the [Sentor ML API Swagger Playground](https://sentor.app/docs).
202
+
203
+ ## Contributing
204
+
205
+ Contributions are welcome! Please feel free to submit a Pull Request.
206
+
207
+ ## License
208
+
209
+ MIT License - see the [LICENSE](LICENSE) file for details.
@@ -0,0 +1,179 @@
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
+ ### Work like a PRO
21
+
22
+ 1. Go to [Sentor ML API](https://sentor.app/api)
23
+ 2. Subscribe to the Starter plan
24
+ 3. Get your API key
25
+
26
+ ## Usage
27
+
28
+ ### Basic Usage
29
+
30
+ ```python
31
+ from sentor import SentorClient
32
+
33
+ # Initialize the client
34
+ client = SentorClient('your-api-key')
35
+
36
+ # Analyze sentiment
37
+ input_data = [
38
+ {
39
+ "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.",
40
+ "doc_id": "0",
41
+ "entities": [
42
+ "Apple",
43
+ "Samsung",
44
+ "camera"
45
+ ]
46
+ },
47
+ {
48
+ "doc": "Apple's new iPhone is amazing!",
49
+ "doc_id": "1",
50
+ "entities": [
51
+ "Apple",
52
+ "iPhone"
53
+ ]
54
+ },
55
+ {
56
+ "doc": "Samsung's new phone is amazing!",
57
+ "doc_id": "2",
58
+ "entities": [
59
+ "Samsung",
60
+ "phone"
61
+ ]
62
+ }
63
+ ]
64
+ result = client.analyze(input_data)
65
+ print(result)
66
+ ```
67
+
68
+ ### Sample Output
69
+
70
+ ```json
71
+ {
72
+ "results": [
73
+ {
74
+ "doc_id": "0",
75
+ "predicted_class": 2,
76
+ "predicted_label": "positive",
77
+ "probabilities": {
78
+ "negative": 0.00007679959526285529,
79
+ "neutral": 0.0002924697764683515,
80
+ "positive": 0.9996306896209717
81
+ },
82
+ "details": [
83
+ {
84
+ "sentence_index": 0,
85
+ "sentence_text": "In the competitive landscape of consumer electronics, Apple and Samsung continue to lead the market with innovative products and strong brand loyalty.",
86
+ "predicted_class": 2,
87
+ "predicted_label": "positive",
88
+ "probabilities": {
89
+ "negative": 0.00009389198385179043,
90
+ "neutral": 0.00032428017584607005,
91
+ "positive": 0.9995818734169006
92
+ }
93
+ },
94
+ {
95
+ "sentence_index": 1,
96
+ "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.",
97
+ "predicted_class": 2,
98
+ "predicted_label": "positive",
99
+ "probabilities": {
100
+ "negative": 0.00005746580063714646,
101
+ "neutral": 0.00012963586777914315,
102
+ "positive": 0.99981290102005
103
+ }
104
+ },
105
+ {
106
+ "sentence_index": 2,
107
+ "sentence_text": "Both companies push the boundaries of technology, from cutting-edge chipsets to advanced camera systems, often setting industry trends that others follow.",
108
+ "predicted_class": 2,
109
+ "predicted_label": "positive",
110
+ "probabilities": {
111
+ "negative": 0.00006366783054545522,
112
+ "neutral": 0.00044553453335538507,
113
+ "positive": 0.9994907379150391
114
+ }
115
+ }
116
+ ]
117
+ },
118
+ {
119
+ "doc_id": "1",
120
+ "predicted_class": 2,
121
+ "predicted_label": "positive",
122
+ "probabilities": {
123
+ "negative": 0.00010637375817168504,
124
+ "neutral": 0.0002509312762413174,
125
+ "positive": 0.9996427297592163
126
+ },
127
+ "details": [
128
+ {
129
+ "sentence_index": 0,
130
+ "sentence_text": "Apple's new iPhone is amazing!",
131
+ "predicted_class": 2,
132
+ "predicted_label": "positive",
133
+ "probabilities": {
134
+ "negative": 0.00010637375817168504,
135
+ "neutral": 0.0002509312762413174,
136
+ "positive": 0.9996427297592163
137
+ }
138
+ }
139
+ ]
140
+ },
141
+ {
142
+ "doc_id": "2",
143
+ "predicted_class": 2,
144
+ "predicted_label": "positive",
145
+ "probabilities": {
146
+ "negative": 0.00010637375817168504,
147
+ "neutral": 0.0002509312762413174,
148
+ "positive": 0.9996427297592163
149
+ },
150
+ "details": [
151
+ {
152
+ "sentence_index": 0,
153
+ "sentence_text": "Samsung's new phone is amazing!",
154
+ "predicted_class": 2,
155
+ "predicted_label": "positive",
156
+ "probabilities": {
157
+ "negative": 0.00010637375817168504,
158
+ "neutral": 0.0002509312762413174,
159
+ "positive": 0.9996427297592163
160
+ }
161
+ }
162
+ ]
163
+ }
164
+ ]
165
+ }
166
+ ```
167
+
168
+ ## API Reference
169
+
170
+ Please refer to the [Sentor ML API Documentation](https://sentor.app/docs) for more details.
171
+ You can also try the API in the [Sentor ML API Swagger Playground](https://sentor.app/docs).
172
+
173
+ ## Contributing
174
+
175
+ Contributions are welcome! Please feel free to submit a Pull Request.
176
+
177
+ ## License
178
+
179
+ MIT License - see the [LICENSE](LICENSE) file for details.
@@ -17,7 +17,7 @@ class SentorClient:
17
17
  def __init__(
18
18
  self,
19
19
  api_key: str,
20
- base_url: str = "https://ml.sentor.app/api",
20
+ base_url: str = "https://sentor.app/api",
21
21
  timeout: int = 30,
22
22
  ):
23
23
  """
@@ -49,7 +49,7 @@ class SentorClient:
49
49
  if not documents:
50
50
  raise ValueError("Input is required")
51
51
 
52
- url = f"{self.base_url}/ml/predict"
52
+ url = f"{self.base_url}/predicts"
53
53
  payload = {"docs": documents}
54
54
  response = requests.post(
55
55
  url, json=payload, headers=self.headers, timeout=self.timeout
@@ -73,7 +73,7 @@ class SentorClient:
73
73
  Raises:
74
74
  SentorAPIError: If health check fails
75
75
  """
76
- url = f"{self.base_url}/health"
76
+ url = f"{self.base_url}/predicts/health"
77
77
  response = requests.get(
78
78
  url,
79
79
  headers=self.headers,
@@ -0,0 +1,209 @@
1
+ Metadata-Version: 2.4
2
+ Name: sentor-ml
3
+ Version: 1.1.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
+ - 🌍 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
+ ### 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
+ # Analyze 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
+ result = client.analyze(input_data)
95
+ print(result)
96
+ ```
97
+
98
+ ### Sample Output
99
+
100
+ ```json
101
+ {
102
+ "results": [
103
+ {
104
+ "doc_id": "0",
105
+ "predicted_class": 2,
106
+ "predicted_label": "positive",
107
+ "probabilities": {
108
+ "negative": 0.00007679959526285529,
109
+ "neutral": 0.0002924697764683515,
110
+ "positive": 0.9996306896209717
111
+ },
112
+ "details": [
113
+ {
114
+ "sentence_index": 0,
115
+ "sentence_text": "In the competitive landscape of consumer electronics, Apple and Samsung continue to lead the market with innovative products and strong brand loyalty.",
116
+ "predicted_class": 2,
117
+ "predicted_label": "positive",
118
+ "probabilities": {
119
+ "negative": 0.00009389198385179043,
120
+ "neutral": 0.00032428017584607005,
121
+ "positive": 0.9995818734169006
122
+ }
123
+ },
124
+ {
125
+ "sentence_index": 1,
126
+ "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.",
127
+ "predicted_class": 2,
128
+ "predicted_label": "positive",
129
+ "probabilities": {
130
+ "negative": 0.00005746580063714646,
131
+ "neutral": 0.00012963586777914315,
132
+ "positive": 0.99981290102005
133
+ }
134
+ },
135
+ {
136
+ "sentence_index": 2,
137
+ "sentence_text": "Both companies push the boundaries of technology, from cutting-edge chipsets to advanced camera systems, often setting industry trends that others follow.",
138
+ "predicted_class": 2,
139
+ "predicted_label": "positive",
140
+ "probabilities": {
141
+ "negative": 0.00006366783054545522,
142
+ "neutral": 0.00044553453335538507,
143
+ "positive": 0.9994907379150391
144
+ }
145
+ }
146
+ ]
147
+ },
148
+ {
149
+ "doc_id": "1",
150
+ "predicted_class": 2,
151
+ "predicted_label": "positive",
152
+ "probabilities": {
153
+ "negative": 0.00010637375817168504,
154
+ "neutral": 0.0002509312762413174,
155
+ "positive": 0.9996427297592163
156
+ },
157
+ "details": [
158
+ {
159
+ "sentence_index": 0,
160
+ "sentence_text": "Apple's new iPhone is amazing!",
161
+ "predicted_class": 2,
162
+ "predicted_label": "positive",
163
+ "probabilities": {
164
+ "negative": 0.00010637375817168504,
165
+ "neutral": 0.0002509312762413174,
166
+ "positive": 0.9996427297592163
167
+ }
168
+ }
169
+ ]
170
+ },
171
+ {
172
+ "doc_id": "2",
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": "Samsung's new phone 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
+ }
196
+ ```
197
+
198
+ ## API Reference
199
+
200
+ Please refer to the [Sentor ML API Documentation](https://sentor.app/docs) for more details.
201
+ You can also try the API in the [Sentor ML API Swagger Playground](https://sentor.app/docs).
202
+
203
+ ## Contributing
204
+
205
+ Contributions are welcome! Please feel free to submit a Pull Request.
206
+
207
+ ## License
208
+
209
+ 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.1",
8
+ version="1.1.0",
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",
@@ -20,7 +20,7 @@ def test_client_initialization():
20
20
  client = SentorClient(api_key="test-key")
21
21
  assert isinstance(client, SentorClient)
22
22
  assert client.api_key == "test-key"
23
- assert client.base_url == "https://ml.sentor.app/api"
23
+ assert client.base_url == "https://sentor.app/api"
24
24
  assert client.timeout == 30
25
25
 
26
26
 
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