Download fastapi_app/templates/index.html from codeby-hp/finetuneTinyBERT-SentimentClassification: direct link, hf CLI and curl.
- Browser
- Download file 3.86 kB
-
https://huggingface.co/spaces/codeby-hp/finetuneTinyBERT-SentimentClassification/resolve/main/fastapi_app/templates/index.html
- Command line
-
hf download hf://spaces/codeby-hp/finetuneTinyBERT-SentimentClassification/fastapi_app/templates/index.html
-
curl -L -o index.html https://huggingface.co/spaces/codeby-hp/finetuneTinyBERT-SentimentClassification/resolve/main/fastapi_app/templates/index.html
3.86 kB
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8" /> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
| <title>Sentiment Analysis - TinyBERT</title> | |
| <script src="https://cdn.tailwindcss.com"></script> | |
| </head> | |
| <body class="bg-gradient-to-br from-slate-50 to-slate-100 min-h-screen"> | |
| <div class="container mx-auto px-4 py-12 max-w-3xl"> | |
| <!-- Header --> | |
| <div class="text-center mb-12"> | |
| <h1 class="text-4xl font-bold text-slate-800 mb-3"> | |
| Sentiment Analysis | |
| </h1> | |
| <p class="text-slate-600"> | |
| Powered by Fine-tuned TinyBERT | |
| </p> | |
| </div> | |
| <!-- Main Card --> | |
| <div class="bg-white rounded-2xl shadow-xl p-8 mb-6"> | |
| <form method="post" action="/predict" class="space-y-6"> | |
| <!-- Text Input --> | |
| <div> | |
| <label for="text" class="block text-sm font-medium text-slate-700 mb-2"> | |
| Enter text to analyze | |
| </label> | |
| <textarea | |
| id="text" | |
| name="text" | |
| rows="5" | |
| class="w-full px-4 py-3 border border-slate-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent transition resize-none" | |
| placeholder="Type or paste your text here..." | |
| required | |
| >{% if text %}{{ text }}{% endif %}</textarea> | |
| </div> | |
| <!-- Submit Button --> | |
| <button | |
| type="submit" | |
| class="w-full bg-blue-600 hover:bg-blue-700 text-white font-medium py-3 px-6 rounded-lg transition duration-200 shadow-md hover:shadow-lg" | |
| > | |
| Analyze Sentiment | |
| </button> | |
| </form> | |
| <!-- Error Message --> | |
| {% if error %} | |
| <div class="mt-6 bg-red-50 border-l-4 border-red-500 p-4 rounded"> | |
| <p class="text-red-700">{{ error }}</p> | |
| </div> | |
| {% endif %} | |
| <!-- Results --> | |
| {% if sentiment %} | |
| <div class="mt-8 border-t pt-6"> | |
| <h2 class="text-xl font-semibold text-slate-800 mb-4">Results</h2> | |
| <div class="grid grid-cols-2 gap-4"> | |
| <!-- Sentiment --> | |
| <div class="bg-slate-50 rounded-lg p-4"> | |
| <p class="text-sm text-slate-600 mb-1">Sentiment</p> | |
| <div class="flex items-center"> | |
| <span class="text-2xl mr-2"> | |
| {% if sentiment == "Positive" %} | |
| ๐ | |
| {% else %} | |
| ๐ | |
| {% endif %} | |
| </span> | |
| <p class="text-2xl font-bold {% if sentiment == 'Positive' %}text-green-600{% else %}text-red-600{% endif %}"> | |
| {{ sentiment }} | |
| </p> | |
| </div> | |
| </div> | |
| <!-- Confidence --> | |
| <div class="bg-slate-50 rounded-lg p-4"> | |
| <p class="text-sm text-slate-600 mb-1">Confidence</p> | |
| <p class="text-2xl font-bold text-blue-600"> | |
| {{ confidence }}% | |
| </p> | |
| </div> | |
| </div> | |
| <!-- Confidence Bar --> | |
| <div class="mt-4"> | |
| <div class="w-full bg-slate-200 rounded-full h-3 overflow-hidden"> | |
| <div | |
| class="h-full {% if sentiment == 'Positive' %}bg-green-500{% else %}bg-red-500{% endif %} transition-all duration-500" | |
| style="width: {{ confidence }}%" | |
| ></div> | |
| </div> | |
| </div> | |
| </div> | |
| {% endif %} | |
| </div> | |
| <!-- Footer --> | |
| <div class="text-center text-slate-500 text-sm"> | |
| <p>Fine-tuned TinyBERT model for sentiment classification</p> | |
| </div> | |
| </div> | |
| </body> | |
| </html> |