nyddle commited on
Commit
ab9d429
·
0 Parent(s):

Add application file

Browse files
Files changed (2) hide show
  1. app.py +37 -0
  2. requirements.txt +459 -0
app.py ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import json
2
+ import gradio as gr
3
+ from textblob import TextBlob
4
+
5
+ def sentiment_analysis(text: str) -> str:
6
+ """
7
+ Analyze the sentiment of the given text.
8
+
9
+ Args:
10
+ text (str): The text to analyze
11
+
12
+ Returns:
13
+ str: A JSON string containing polarity, subjectivity, and assessment
14
+ """
15
+ blob = TextBlob(text)
16
+ sentiment = blob.sentiment
17
+
18
+ result = {
19
+ "polarity": round(sentiment.polarity, 2), # -1 (negative) to 1 (positive)
20
+ "subjectivity": round(sentiment.subjectivity, 2), # 0 (objective) to 1 (subjective)
21
+ "assessment": "positive" if sentiment.polarity > 0 else "negative" if sentiment.polarity < 0 else "neutral"
22
+ }
23
+
24
+ return json.dumps(result)
25
+
26
+ # Create the Gradio interface
27
+ demo = gr.Interface(
28
+ fn=sentiment_analysis,
29
+ inputs=gr.Textbox(placeholder="Enter text to analyze..."),
30
+ outputs=gr.Textbox(), # Changed from gr.JSON() to gr.Textbox()
31
+ title="Text Sentiment Analysis",
32
+ description="Analyze the sentiment of text using TextBlob"
33
+ )
34
+
35
+ # Launch the interface and MCP server
36
+ if __name__ == "__main__":
37
+ demo.launch(mcp_server=True)
requirements.txt ADDED
@@ -0,0 +1,459 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ a2wsgi==1.10.8
2
+ aiogram==2.25.2
3
+ aiohappyeyeballs==2.4.4
4
+ aiohttp==3.11.11
5
+ aiosignal==1.3.1
6
+ aiosqlite==0.20.0
7
+ alabaster==0.7.12
8
+ alembic==1.14.0
9
+ algoliasearch==3.0.0
10
+ algoliasearch-django==3.0.0
11
+ amqp==5.2.0
12
+ annotated-types==0.6.0
13
+ anyio==4.2.0
14
+ appdirs==1.4.4
15
+ appnope==0.1.3
16
+ APScheduler==3.10.4
17
+ argon2-cffi==23.1.0
18
+ argon2-cffi-bindings==21.2.0
19
+ arrow==0.15.6
20
+ asgiref==3.7.2
21
+ asttokens==2.4.1
22
+ async-lru==2.0.4
23
+ async-timeout==4.0.3
24
+ asyncpg==0.30.0
25
+ attrs==23.2.0
26
+ auth0-python==4.7.2
27
+ autopep8==1.5.4
28
+ awscli==1.31.4
29
+ Babel==2.9.1
30
+ backoff==2.2.1
31
+ backports.tarfile==1.2.0
32
+ bcrypt==4.1.2
33
+ beautifulsoup4==4.12.3
34
+ bentoml==1.3.20
35
+ billiard==3.6.3.0
36
+ bleach==6.1.0
37
+ boto3==1.14.56
38
+ botocore==1.17.56
39
+ braintree==4.11.0
40
+ bs4==0.0.2
41
+ build==1.2.2.post1
42
+ CacheControl==0.14.2
43
+ cachetools==5.3.2
44
+ calendly==1.1.1
45
+ cattrs==23.1.2
46
+ celery==5.0.5
47
+ Cerberus==1.3.2
48
+ certifi==2024.12.14
49
+ cffi==1.17.1
50
+ chardet==3.0.4
51
+ charset-normalizer==3.4.1
52
+ chroma-hnswlib==0.7.6
53
+ chromadb==0.5.23
54
+ cleo==2.1.0
55
+ click==8.1.7
56
+ click-didyoumean==0.3.0
57
+ click-option-group==0.5.6
58
+ click-plugins==1.1.1
59
+ click-repl==0.2.0
60
+ cloudinary==1.19.1
61
+ cloudpickle==3.1.1
62
+ cohere==5.13.3
63
+ colorama==0.4.4
64
+ coloredlogs==15.0.1
65
+ comm==0.2.1
66
+ coreapi==2.3.3
67
+ coreschema==0.0.4
68
+ coverage==5.5
69
+ crashtest==0.4.1
70
+ crewai==0.86.0
71
+ crewai-tools==0.17.0
72
+ cron-descriptor==1.2.24
73
+ cryptography==43.0.3
74
+ curlify==2.2.1
75
+ dataclasses-json==0.6.4
76
+ datasets==2.19.1
77
+ dateparser==0.7.2
78
+ debugpy==1.8.0
79
+ decorator==5.1.1
80
+ deepdiff==5.5.0
81
+ deepmerge==2.0
82
+ defusedxml==0.7.1
83
+ Deprecated==1.2.13
84
+ deprecation==2.1.0
85
+ dill==0.3.8
86
+ distlib==0.3.9
87
+ distro==1.9.0
88
+ dj-database-url==0.5.0
89
+ Django==2.2.5
90
+ django-admin-sortable2==1.0.2
91
+ django-anymail==8.4
92
+ django-constance==2.9.0
93
+ django-cors-headers==3.7.0
94
+ django-cronfield==0.2
95
+ django-extensions==3.1.3
96
+ django-filter==2.4.0
97
+ django-heroku==0.3.1
98
+ django-redis==5.2.0
99
+ django-referrer-policy==1.0
100
+ django-rest-framework==0.1.0
101
+ django-rest-swagger==2.2.0
102
+ django-shell-plus==1.1.7
103
+ django-storages==1.11.1
104
+ django-tinymce==3.3.0
105
+ django-tinymce4-lite==1.8.0
106
+ django-waitress==0.1.0
107
+ djangorestframework==3.12.4
108
+ dnspython==1.16.0
109
+ docker==7.1.0
110
+ docopt==0.6.2
111
+ docstring_parser==0.16
112
+ docutils==0.15.2
113
+ docx2txt==0.8
114
+ drf-dynamic-fields==0.3.1
115
+ drf-firebase-authentication==1.0.1
116
+ drf-yasg==1.17.0
117
+ dulwich==0.22.7
118
+ -e git+https://ad:gkhay3rpskTEx5QHSpHz@gitlab.com/tststrn/elixir-api.git@6d573bdefcec217b22b25df1598481d38cc02668#egg=elixir_api
119
+ embedchain==0.1.125
120
+ et-xmlfile==1.0.1
121
+ executing==2.0.1
122
+ facebook-business==17.0.0
123
+ factory-boy==2.12.0
124
+ faiss-cpu==1.7.4
125
+ Faker==3.0.0
126
+ fastapi==0.109.2
127
+ fastavro==1.9.7
128
+ fastjsonschema==2.21.1
129
+ filelock==3.16.1
130
+ finvizfinance==1.1.0
131
+ firebase-admin==3.0.0
132
+ flatbuffers==23.5.26
133
+ fqdn==1.5.1
134
+ frozenlist==1.4.1
135
+ fs==2.4.16
136
+ fsspec==2024.2.0
137
+ geoip2==4.7.0
138
+ gevent==23.9.1
139
+ gitdb==4.0.11
140
+ GitPython==3.1.41
141
+ google-api-core==2.24.0
142
+ google-api-python-client==1.12.0
143
+ google-auth==2.23.4
144
+ google-auth-httplib2==0.0.4
145
+ google-cloud-aiplatform==1.74.0
146
+ google-cloud-bigquery==3.27.0
147
+ google-cloud-core==2.4.1
148
+ google-cloud-firestore==2.13.1
149
+ google-cloud-resource-manager==1.13.1
150
+ google-cloud-storage==2.13.0
151
+ google-crc32c==1.5.0
152
+ google-resumable-media==2.6.0
153
+ googleapis-common-protos==1.66.0
154
+ gptcache==0.1.44
155
+ greenlet==3.0.1
156
+ grpc-google-iam-v1==0.13.1
157
+ grpcio==1.69.0
158
+ grpcio-status==1.69.0
159
+ grpcio-tools==1.68.1
160
+ gunicorn==20.0.4
161
+ h11==0.14.0
162
+ h2==4.1.0
163
+ hpack==4.0.0
164
+ httpagentparser==1.9.5
165
+ httpcore==1.0.7
166
+ httplib2==0.14.0
167
+ httptools==0.6.1
168
+ httpx==0.27.2
169
+ httpx-sse==0.4.0
170
+ httpx-ws==0.7.1
171
+ huggingface-hub==0.23.1
172
+ humanfriendly==10.0
173
+ hyperframe==6.0.1
174
+ idna==3.10
175
+ imagesize==1.1.0
176
+ importlib-resources==6.1.1
177
+ importlib_metadata==8.5.0
178
+ inflect==7.0.0
179
+ inflection==0.3.1
180
+ Inflector==3.0.0
181
+ iniconfig==1.1.1
182
+ installer==0.7.0
183
+ instructor==1.7.0
184
+ ipykernel==6.28.0
185
+ ipython==8.20.0
186
+ isoduration==20.11.0
187
+ itypes==1.1.0
188
+ jaraco.classes==3.4.0
189
+ jaraco.context==6.0.1
190
+ jaraco.functools==4.1.0
191
+ jdcal==1.4.1
192
+ jedi==0.19.1
193
+ Jinja2==3.1.4
194
+ jiter==0.6.1
195
+ jmespath==0.9.5
196
+ jsmin==3.0.1
197
+ json5==0.9.14
198
+ json_repair==0.30.3
199
+ jsonpatch==1.33
200
+ jsonpickle==4.0.0
201
+ jsonpointer==2.4
202
+ jsonref==1.1.0
203
+ jsonschema==4.23.0
204
+ jsonschema-specifications==2023.12.1
205
+ jupyter-events==0.9.0
206
+ jupyter-lsp==2.2.1
207
+ jupyter_client==8.6.0
208
+ jupyter_core==5.7.1
209
+ jupyter_server==2.12.3
210
+ jupyter_server_terminals==0.5.1
211
+ jupyterlab==4.0.10
212
+ jupyterlab_pygments==0.3.0
213
+ jupyterlab_server==2.25.2
214
+ kantoku==0.18.1
215
+ keyring==25.6.0
216
+ kombu==5.0.2
217
+ kubernetes==29.0.0
218
+ lancedb==0.17.0
219
+ langchain==0.3.10
220
+ langchain-cli==0.0.21
221
+ langchain-cohere==0.3.3
222
+ langchain-community==0.3.10
223
+ langchain-core==0.3.23
224
+ langchain-experimental==0.3.3
225
+ langchain-openai==0.2.12
226
+ langchain-text-splitters==0.3.2
227
+ langchainhub==0.1.14
228
+ langserve==0.0.41
229
+ langsmith==0.1.147
230
+ litellm==1.54.1
231
+ livereload==2.6.1
232
+ lxml==5.3.0
233
+ magic-filter==1.0.12
234
+ mailchimp3==3.0.14
235
+ Mako==1.1.0
236
+ Markdown==3.1.1
237
+ markdown-it-py==3.0.0
238
+ MarkupSafe==2.1.5
239
+ marshmallow==3.20.2
240
+ matplotlib-inline==0.1.6
241
+ maxminddb==2.4.0
242
+ mdurl==0.1.2
243
+ mem0ai==0.1.34
244
+ mistune==3.0.2
245
+ mkdocs==1.0.4
246
+ mmh3==4.1.0
247
+ mock==3.0.5
248
+ monotonic==1.6
249
+ more-itertools==10.6.0
250
+ motor==3.6.1
251
+ mpmath==1.3.0
252
+ msgpack==1.1.0
253
+ multidict==5.1.0
254
+ multiprocess==0.70.16
255
+ mypy-extensions==1.0.0
256
+ nbclient==0.9.0
257
+ nbconvert==7.14.0
258
+ nbformat==5.9.2
259
+ nest-asyncio==1.5.8
260
+ networkx==3.4.2
261
+ newrelic==9.1.1
262
+ nodeenv==1.9.1
263
+ nose==1.3.7
264
+ notebook==7.0.7
265
+ notebook_shim==0.2.3
266
+ num2words==0.5.13
267
+ numpy==1.26.1
268
+ nvidia-ml-py==12.560.30
269
+ oauthlib==3.2.2
270
+ onnxruntime==1.17.0
271
+ openai==1.57.1
272
+ openapi-codec==1.3.2
273
+ openpyxl==3.1.5
274
+ opentelemetry-api==1.28.2
275
+ opentelemetry-exporter-otlp-proto-common==1.28.2
276
+ opentelemetry-exporter-otlp-proto-grpc==1.28.2
277
+ opentelemetry-exporter-otlp-proto-http==1.28.2
278
+ opentelemetry-instrumentation==0.49b2
279
+ opentelemetry-instrumentation-aiohttp-client==0.49b2
280
+ opentelemetry-instrumentation-asgi==0.49b2
281
+ opentelemetry-instrumentation-fastapi==0.49b2
282
+ opentelemetry-proto==1.28.2
283
+ opentelemetry-sdk==1.28.2
284
+ opentelemetry-semantic-conventions==0.49b2
285
+ opentelemetry-util-http==0.49b2
286
+ ordered-set==4.0.2
287
+ orjson==3.10.12
288
+ outcome==1.3.0.post0
289
+ overrides==7.4.0
290
+ packaging==24.2
291
+ pandas==2.1.2
292
+ pandocfilters==1.5.0
293
+ parameterized==0.9.0
294
+ parso==0.8.3
295
+ pathspec==0.12.1
296
+ pdfminer.six==20231228
297
+ pdfplumber==0.11.4
298
+ pdoc3==0.7.1
299
+ pexpect==4.9.0
300
+ pillow==11.0.0
301
+ pip-requirements-parser==32.0.1
302
+ pkginfo==1.12.0
303
+ platformdirs==4.3.6
304
+ pluggy==1.5.0
305
+ poetry==2.0.1
306
+ poetry-core==2.0.1
307
+ portalocker==2.10.1
308
+ posthog==3.7.4
309
+ postmarker==1.0
310
+ prometheus-client==0.19.0
311
+ prompt-toolkit==3.0.43
312
+ propcache==0.2.1
313
+ proto-plus==1.25.0
314
+ protobuf==5.29.3
315
+ psutil==5.9.7
316
+ psycopg2==2.9.10
317
+ ptyprocess==0.7.0
318
+ pulsar-client==3.4.0
319
+ pure-eval==0.2.2
320
+ py==1.10.0
321
+ pyarrow==16.1.0
322
+ pyarrow-hotfix==0.6
323
+ pyasn1==0.4.8
324
+ pyasn1-modules==0.2.7
325
+ pycodestyle==2.6.0
326
+ pycountry==20.7.3
327
+ pycparser==2.22
328
+ pycron==3.0.0
329
+ pycurl==7.45.2
330
+ pydantic==2.10.3
331
+ pydantic-settings==2.6.1
332
+ pydantic_core==2.27.1
333
+ pydoc-markdown==2.0.5
334
+ pydotenv==0.0.7
335
+ Pygments==2.17.2
336
+ PyJWT==2.10.1
337
+ pylance==0.20.0
338
+ pymongo==4.9.2
339
+ pyparsing==2.4.2
340
+ pypdf==5.1.0
341
+ pypdfium2==4.30.0
342
+ PyPika==0.48.9
343
+ pyproject_hooks==1.2.0
344
+ pyright==1.1.390
345
+ pysbd==0.3.4
346
+ PySocks==1.7.1
347
+ pytest==8.3.4
348
+ pytest-cov==2.12.1
349
+ pytest-django==4.4.0
350
+ python-crontab==1.9.3
351
+ python-dateutil==2.8.2
352
+ python-dotenv==1.0.1
353
+ python-json-logger==2.0.7
354
+ python-multipart==0.0.20
355
+ pytube==15.0.0
356
+ pytz==2024.1
357
+ pyvis==0.3.2
358
+ PyYAML==6.0.1
359
+ pyzmq==25.1.2
360
+ qdrant-client==1.12.1
361
+ quantulum3==0.7.6
362
+ questionary==2.1.0
363
+ RapidFuzz==3.11.0
364
+ redis==5.0.1
365
+ referencing==0.32.1
366
+ regex==2024.11.6
367
+ requests==2.32.3
368
+ requests-oauthlib==1.3.1
369
+ requests-toolbelt==1.0.0
370
+ retry==0.9.2
371
+ rfc3339-validator==0.1.4
372
+ rfc3986-validator==0.1.1
373
+ rich==13.7.0
374
+ rpds-py==0.16.2
375
+ rq==1.15.1
376
+ rsa==4.0
377
+ ruamel.yaml==0.18.5
378
+ ruamel.yaml.clib==0.2.8
379
+ s3transfer==0.3.3
380
+ schema==0.7.7
381
+ selenium==4.27.1
382
+ Send2Trash==1.8.2
383
+ sentry-sdk==0.12.1
384
+ shapely==2.0.6
385
+ shellingham==1.5.4
386
+ simple-di==0.1.5
387
+ simplejson==3.17.0
388
+ six==1.12.0
389
+ smmap==5.0.1
390
+ sniffio==1.3.0
391
+ snowballstemmer==2.0.0
392
+ sortedcontainers==2.4.0
393
+ soupsieve==1.9.5
394
+ Sphinx==2.2.0
395
+ sphinxcontrib-applehelp==1.0.1
396
+ sphinxcontrib-devhelp==1.0.1
397
+ sphinxcontrib-htmlhelp==1.0.2
398
+ sphinxcontrib-jsmath==1.0.1
399
+ sphinxcontrib-qthelp==1.0.2
400
+ sphinxcontrib-serializinghtml==1.1.3
401
+ SQLAlchemy==2.0.36
402
+ sqlparse==0.3.0
403
+ sse-starlette==1.8.2
404
+ stack-data==0.6.3
405
+ starlette==0.36.3
406
+ stripe==11.4.1
407
+ sympy==1.12
408
+ tabulate==0.9.0
409
+ tenacity==9.0.0
410
+ terminado==0.18.0
411
+ text-unidecode==1.3
412
+ tiktoken==0.7.0
413
+ tinycss2==1.2.1
414
+ tokenizers==0.15.2
415
+ toml==0.10.2
416
+ tomli==2.2.1
417
+ tomli_w==1.1.0
418
+ tomlkit==0.13.2
419
+ tornado==6.4
420
+ tqdm==4.66.1
421
+ traitlets==5.14.1
422
+ trio==0.27.0
423
+ trio-websocket==0.11.1
424
+ trove-classifiers==2025.1.15.22
425
+ ttl-cache==1.6
426
+ typer==0.9.0
427
+ types-requests==2.31.0.20240125
428
+ typing==3.7.4.1
429
+ typing-inspect==0.9.0
430
+ typing_extensions==4.12.2
431
+ tzdata==2023.3
432
+ tzlocal==2.0.0
433
+ uri-template==1.3.0
434
+ uritemplate==3.0.0
435
+ urllib3==2.3.0
436
+ uv==0.5.7
437
+ uvicorn==0.23.2
438
+ uvloop==0.19.0
439
+ uWSGI==2.0.23
440
+ validate-email==1.3
441
+ vine==5.0.0
442
+ virtualenv==20.29.1
443
+ waitress==1.4.4
444
+ watchfiles==0.21.0
445
+ wcwidth==0.1.8
446
+ webcolors==1.13
447
+ webencodings==0.5.1
448
+ websocket-client==1.8.0
449
+ websockets==12.0
450
+ whitenoise==4.1.3
451
+ wrapt==1.16.0
452
+ wsproto==1.2.0
453
+ xattr==1.1.4
454
+ XlsxWriter==3.0.8
455
+ xxhash==3.4.1
456
+ yarl==1.18.3
457
+ zipp==3.21.0
458
+ zope.event==5.0
459
+ zope.interface==6.1