Spaces:
Sleeping
Sleeping
Commit ·
634da92
1
Parent(s): cf9847a
Streamlit issue 5
Browse filesFiles changed (4)
- Dockerfile+2-2
- src/__pycache__/helpers.cpython-312.pycDeleted
- src/helpers.pyDeleted-43
- src/streamlit_app.py+41-1
123456FROM python:3.13.5-slimWORKDIR $HOME/appRUN apt-get update && apt-get install -y \build-essential \123456FROM python:3.9-slimWORKDIR /appRUN apt-get update && apt-get install -y \build-essential \
12345678910111213141516171819202122232425262728293031323334353637383940414243from datetime import datetimeimport timefrom typing import Dict
# ---------- Helpers ----------def parse_comment_file(file_content: str) -> Dict: """Parse comment file and validate simple `comment | rating` format.""" return none
def count_words(text: str) -> int: return len(text.split()) if text.strip() else 0
def generate_mock_analysis(comment_count: int, original_text: str) -> Dict: """Returns a deterministic mock analysis payload.""" return { "id": str(int(time.time())), "summary": ( f"Based on analysis of {comment_count} customer comments, the feedback shows strong overall " "satisfaction with the product. Customers appreciate quality, intuitive design, and value. " "Pain points: shipping times and initial setup. Sentiment is mostly positive." ), "key_themes": [ "Product Quality", "Ease of Use", "Value for Money", "Shipping & Delivery", "Customer Support", "Design & Functionality", "Reliability", ], "sentiment": {"positive": 72, "neutral": 18, "negative": 10}, "insights": [ "Quality and design receive the highest praise.", "Shipping and delivery times are primary pain points.", "Customer support responsiveness is well-regarded.", "Value perception is strong across segments.", "Reliability meets or exceeds expectations.", "Setup complexity is a minor barrier for some.", ], "timestamp": datetime.now().isoformat(), }4 unmodified lines5678910114 unmodified linesimport pandas as pd# homemade helpersfrom helpers import parse_comment_file, count_words, generate_mock_analysis#TODO add a slider selecting how many lines of summarized text we want4 unmodified lines567891011121314151617181920212223242526272829303132333435363738394041424344454647484950514 unmodified linesimport pandas as pd# homemade helpers# ---------- Helpers ----------def parse_comment_file(file_content: str) -> Dict:"""Parse comment file and validate simple `comment | rating` format."""return nonedef count_words(text: str) -> int:return len(text.split()) if text.strip() else 0def generate_mock_analysis(comment_count: int, original_text: str) -> Dict:"""Returns a deterministic mock analysis payload."""return {"id": str(int(time.time())),"summary": (f"Based on analysis of {comment_count} customer comments, the feedback shows strong overall ""satisfaction with the product. Customers appreciate quality, intuitive design, and value. ""Pain points: shipping times and initial setup. Sentiment is mostly positive."),"key_themes": ["Product Quality","Ease of Use","Value for Money","Shipping & Delivery","Customer Support","Design & Functionality","Reliability",],"sentiment": {"positive": 72, "neutral": 18, "negative": 10},"insights": ["Quality and design receive the highest praise.","Shipping and delivery times are primary pain points.","Customer support responsiveness is well-regarded.","Value perception is strong across segments.","Reliability meets or exceeds expectations.","Setup complexity is a minor barrier for some.",],"timestamp": datetime.now().isoformat(),}#TODO add a slider selecting how many lines of summarized text we want
Dockerfile+2-2
src/__pycache__/helpers.cpython-312.pycDeleted
src/helpers.pyDeleted-43
src/streamlit_app.py+41-1