Spaces:
Sleeping
Sleeping
N Sriram commited on
Commit ·
863c49f
1
Parent(s): d522cc7
change response for validation
Browse files- .idea/workspace.xml +68 -0
- app.py +5 -4
.idea/workspace.xml
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
+
<project version="4">
|
| 3 |
+
<component name="AutoImportSettings">
|
| 4 |
+
<option name="autoReloadType" value="SELECTIVE" />
|
| 5 |
+
</component>
|
| 6 |
+
<component name="ChangeListManager">
|
| 7 |
+
<list default="true" id="2bd2f522-01dd-40af-8640-085674620e57" name="Changes" comment="" />
|
| 8 |
+
<option name="SHOW_DIALOG" value="false" />
|
| 9 |
+
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
| 10 |
+
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
| 11 |
+
<option name="LAST_RESOLUTION" value="IGNORE" />
|
| 12 |
+
</component>
|
| 13 |
+
<component name="FileTemplateManagerImpl">
|
| 14 |
+
<option name="RECENT_TEMPLATES">
|
| 15 |
+
<list>
|
| 16 |
+
<option value="Python Script" />
|
| 17 |
+
</list>
|
| 18 |
+
</option>
|
| 19 |
+
</component>
|
| 20 |
+
<component name="Git.Settings">
|
| 21 |
+
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
| 22 |
+
</component>
|
| 23 |
+
<component name="ProjectColorInfo">{
|
| 24 |
+
"associatedIndex": 8
|
| 25 |
+
}</component>
|
| 26 |
+
<component name="ProjectId" id="2yEZ8D8jalYoZmiVmI6EGR6lIPC" />
|
| 27 |
+
<component name="ProjectViewState">
|
| 28 |
+
<option name="hideEmptyMiddlePackages" value="true" />
|
| 29 |
+
<option name="showLibraryContents" value="true" />
|
| 30 |
+
</component>
|
| 31 |
+
<component name="PropertiesComponent">{
|
| 32 |
+
"keyToString": {
|
| 33 |
+
"ModuleVcsDetector.initialDetectionPerformed": "true",
|
| 34 |
+
"RunOnceActivity.ShowReadmeOnStart": "true",
|
| 35 |
+
"RunOnceActivity.git.unshallow": "true",
|
| 36 |
+
"git-widget-placeholder": "main",
|
| 37 |
+
"last_opened_file_path": "/Users/sriram/hugging-face/mcp-sentiment",
|
| 38 |
+
"node.js.detected.package.eslint": "true",
|
| 39 |
+
"node.js.detected.package.tslint": "true",
|
| 40 |
+
"node.js.selected.package.eslint": "(autodetect)",
|
| 41 |
+
"node.js.selected.package.tslint": "(autodetect)",
|
| 42 |
+
"nodejs_package_manager_path": "npm",
|
| 43 |
+
"vue.rearranger.settings.migration": "true"
|
| 44 |
+
}
|
| 45 |
+
}</component>
|
| 46 |
+
<component name="SharedIndexes">
|
| 47 |
+
<attachedChunks>
|
| 48 |
+
<set>
|
| 49 |
+
<option value="bundled-js-predefined-d6986cc7102b-6a121458b545-JavaScript-PY-251.25410.159" />
|
| 50 |
+
<option value="bundled-python-sdk-e0ed3721d81e-36ea0e71a18c-com.jetbrains.pycharm.pro.sharedIndexes.bundled-PY-251.25410.159" />
|
| 51 |
+
</set>
|
| 52 |
+
</attachedChunks>
|
| 53 |
+
</component>
|
| 54 |
+
<component name="TaskManager">
|
| 55 |
+
<task active="true" id="Default" summary="Default task">
|
| 56 |
+
<changelist id="2bd2f522-01dd-40af-8640-085674620e57" name="Changes" comment="" />
|
| 57 |
+
<created>1749401531609</created>
|
| 58 |
+
<option name="number" value="Default" />
|
| 59 |
+
<option name="presentableId" value="Default" />
|
| 60 |
+
<updated>1749401531609</updated>
|
| 61 |
+
<workItem from="1749401532671" duration="2200000" />
|
| 62 |
+
</task>
|
| 63 |
+
<servers />
|
| 64 |
+
</component>
|
| 65 |
+
<component name="TypeScriptGeneratedFilesManager">
|
| 66 |
+
<option name="version" value="3" />
|
| 67 |
+
</component>
|
| 68 |
+
</project>
|
app.py
CHANGED
|
@@ -16,9 +16,10 @@ def sentiment_analysis(text: str) -> dict:
|
|
| 16 |
sentiment = blob.sentiment
|
| 17 |
|
| 18 |
return {
|
| 19 |
-
"polarity": round(sentiment.polarity,
|
| 20 |
-
"subjectivity": round(sentiment.subjectivity,
|
| 21 |
-
"assessment": "
|
|
|
|
| 22 |
}
|
| 23 |
|
| 24 |
|
|
@@ -33,4 +34,4 @@ demo = gr.Interface(
|
|
| 33 |
|
| 34 |
# Launch the interface and MCP server
|
| 35 |
if __name__ == "__main__":
|
| 36 |
-
demo.launch(mcp_server=True)
|
|
|
|
| 16 |
sentiment = blob.sentiment
|
| 17 |
|
| 18 |
return {
|
| 19 |
+
"polarity": round(sentiment.polarity, 3), # -1 (negative) to 1 (positive)
|
| 20 |
+
"subjectivity": round(sentiment.subjectivity, 3), # 0 (objective) to 1 (subjective)
|
| 21 |
+
"assessment": "Positive" if sentiment.polarity > 0 else "Negative" if sentiment.polarity < 0 else "Neutral",
|
| 22 |
+
"original_text": text,
|
| 23 |
}
|
| 24 |
|
| 25 |
|
|
|
|
| 34 |
|
| 35 |
# Launch the interface and MCP server
|
| 36 |
if __name__ == "__main__":
|
| 37 |
+
demo.launch(mcp_server=True)
|