Spaces:
Sleeping
Sleeping
| from huggingface_hub import snapshot_download | |
| import sys | |
| import gradio as gr | |
| # Download the model repo | |
| repo_path = snapshot_download( | |
| repo_id="DukeShadow/AspectLens-Aspectwise-sentiment-breakdown", | |
| repo_type="model" | |
| ) | |
| # Make inference.py importable | |
| sys.path.insert(0, repo_path) | |
| from inference import predict | |
| def analyze(text): | |
| return predict(text) | |
| gr.Interface( | |
| fn=analyze, | |
| inputs=gr.Textbox(lines=3, placeholder="Enter a product review"), | |
| outputs="json", | |
| title="AspectLens – Aspect-Based Sentiment Analysis", | |
| description="Aspect-wise sentiment analysis for product reviews" | |
| ).launch() |