Browser-Side Sentiment Analysis with Transformers.js – Prompt Example
CODE PREVIEW
エディタを読み込み中…
P
Prompt
Create a single HTML file that uses Transformers.js (via CDN) to run a zero‑shot classification model (typeform/distilbert-base-uncased-mnli) entirely in the browser. The UI should have a text area for user input, and when the user clicks a button, it classifies the sentiment (positive, negative, neutral) and displays the result with a confidence bar and animated text. Use minimal CSS: a centered card, dark theme with neon accents. Add a subtle loading spinner while the model loads. The design should be mobile‑friendly. Output the full HTML.
このサンプルでは、Transformers.js を使ってブラウザ上で zero-shot テキスト分類を実行します。モデル(distilbert-base-uncased-mnli)が感情をポジティブ・ネガティブ・ニュートラルに分類。UIはテキストエリア、分析ボタン、ローディングスピナー、アニメーション付き信頼度バーを備えています。すべての推論はローカルで行われ、サーバー呼び出しはありません。
Prompt Overview
In this sample, we use Transformers.js to perform zero-shot text classification directly in the browser. The model (distilbert-base-uncased-mnli) classifies emotions as positive, negative, or neutral. The UI includes a text area, an analysis button, a loading spinner, and animated confidence bars. All inference is performed locally with no server calls.
Was this prompt helpful?
Comments
Comments appear after moderation
この記事が役に立ったら投げ銭で応援
Apple Pay / Google Pay / カード (Visa/Mastercard/JCB/Amex) / Link / Alipay / WeChat Pay 対応 · Stripeで安全に決済
開発者が選ぶ最強ツール集
運営者が毎日使っているツール・ガジェット 6選