Spaces:
Running
Running
Vojtěch Mahdal
API key field: collapse to status+Edit once saved; refresh Engine dropdown on save
f43f4b5 Download static/index.html from vojmahdal/sentiment_analysis: direct link, hf CLI and curl.
- Browser
- Download file 4.84 kB
-
https://huggingface.co/spaces/vojmahdal/sentiment_analysis/resolve/main/static/index.html
- Command line
-
hf download hf://spaces/vojmahdal/sentiment_analysis/static/index.html
-
curl -L -o index.html https://huggingface.co/spaces/vojmahdal/sentiment_analysis/resolve/main/static/index.html
4.84 kB
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <meta name="viewport" content="width=device-width, initial-scale=1" /> | |
| <title>Conversation Data Extraction</title> | |
| <link rel="stylesheet" href="/static/styles.css" /> | |
| </head> | |
| <body> | |
| <main class="container"> | |
| <header class="header"> | |
| <h1>Conversation Data Extraction</h1> | |
| <p class="sub"> | |
| Extracts named entities, topics and sentiment from chat messages, | |
| pseudonymizes personal data (GDPR) and stores structured results. | |
| </p> | |
| <div id="apiKeyField"></div> | |
| </header> | |
| <!-- Engine: local BERT pipeline, or a configured LLM provider --> | |
| <section class="card"> | |
| <span class="label">Engine</span> | |
| <select id="engineSelect" class="modelSelect"></select> | |
| <p id="llmEngineNote" class="sub small" hidden> | |
| Anonymization happens locally, just like with the local models, | |
| before the pseudonymized text is sent through the API. The chosen | |
| model then determines sentiment, entities and topic in one call. | |
| </p> | |
| </section> | |
| <!-- Single message analysis --> | |
| <section class="card"> | |
| <label class="label" for="text">Message</label> | |
| <textarea | |
| id="text" | |
| rows="5" | |
| placeholder="Write a message to analyze…" | |
| >Hi, my name is John Smith and I'm really unhappy. My order never arrived. Email me at john.smith@example.com</textarea> | |
| <div class="modelPickers"> | |
| <div> | |
| <span class="label">Sentiment model</span> | |
| <div class="modelPicker" id="sentimentModelPicker" data-task="sentiment"></div> | |
| </div> | |
| <div> | |
| <span class="label">NER (entity extraction) model</span> | |
| <div class="modelPicker" id="nerModelPicker" data-task="ner"></div> | |
| </div> | |
| <div> | |
| <span class="label">Topic classification model</span> | |
| <div class="modelPicker" id="topicModelPicker" data-task="topics"></div> | |
| </div> | |
| </div> | |
| <div class="row"> | |
| <button id="analyzeBtn" class="btn">Analyze</button> | |
| <button id="clearBtn" class="btn secondary" type="button">Clear</button> | |
| <span id="status" class="status" aria-live="polite"></span> | |
| </div> | |
| <div id="result" class="result" hidden> | |
| <div id="engineRow" class="resultRow" hidden> | |
| <span class="k">Engine</span> | |
| <span id="engineInfo" class="v"></span> | |
| </div> | |
| <div class="resultRow"> | |
| <span class="k">Sentiment</span> | |
| <span id="sentiment" class="v"></span> | |
| </div> | |
| <div class="resultRow"> | |
| <span class="k">Topic</span> | |
| <span id="topic" class="v"></span> | |
| </div> | |
| <div class="resultRow column"> | |
| <span class="k">Entities</span> | |
| <div id="entities" class="chips"></div> | |
| </div> | |
| <div class="resultRow column"> | |
| <span class="k">Anonymized text</span> | |
| <code id="anon" class="anon"></code> | |
| </div> | |
| </div> | |
| <pre id="error" class="error" hidden></pre> | |
| </section> | |
| <!-- Batch ingest --> | |
| <section class="card"> | |
| <h2 class="cardTitle">Batch ingest</h2> | |
| <p class="sub small"> | |
| Upload a CSV or JSON file of conversations. Each message is processed by | |
| the full pipeline and stored (anonymized). CSV should have a | |
| <code>text</code> or <code>message</code> column. | |
| </p> | |
| <div class="row"> | |
| <input type="file" id="file" accept=".csv,.json,.tsv,.txt" class="file" /> | |
| <button id="ingestBtn" class="btn" type="button">Ingest file</button> | |
| <span id="ingestStatus" class="status" aria-live="polite"></span> | |
| </div> | |
| <div id="ingestProgress" class="ingestProgress" hidden> | |
| <div class="row"> | |
| <progress id="ingestProgressBar" class="progressBar" value="0" max="1"></progress> | |
| <span id="ingestTimer" class="timer">0.0 s</span> | |
| </div> | |
| <div id="ingestProgressLabel" class="sub small">Processed 0 of 0</div> | |
| </div> | |
| <pre id="ingestError" class="error" hidden></pre> | |
| </section> | |
| <footer class="footer"> | |
| <a href="/docs">API documentation</a> | |
| <span class="dot">•</span> | |
| <a href="/health">Health</a> | |
| <span class="dot">•</span> | |
| <a href="/static/records.html">Records</a> | |
| </footer> | |
| </main> | |
| <script src="/static/apiKey.js"></script> | |
| <script> | |
| renderApiKeyField(document.getElementById("apiKeyField"), { onSave: () => loadEngines() }); | |
| </script> | |
| <script src="/static/app.js"></script> | |
| </body> | |
| </html> | |