用 Transformers.js 在浏览器内做情感分析|AI 生成示例提示词
代码预览
エディタを読み込み中…
P
提示词
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はテキストエリア、分析ボタン、ローディングスピナー、アニメーション付き信頼度バーを備えています。すべての推論はローカルで行われ、サーバー呼び出しはありません。
提示词解读
在此示例中,我们使用 Transformers.js 在浏览器中执行零样本文本分类。模型(distilbert-base-uncased-mnli)将情感分类为正面、负面或中性。UI 包含文本输入区域、分析按钮、加载旋转动画以及带动画效果的置信度条。所有推理均在本地完成,无需服务器调用。
这个提示对您有帮助吗?
评论
评论将在审核后显示
この記事が役に立ったら投げ銭で応援
Apple Pay / Google Pay / カード (Visa/Mastercard/JCB/Amex) / Link / Alipay / WeChat Pay 対応 · Stripeで安全に決済
開発者が選ぶ最強ツール集
運営者が毎日使っているツール・ガジェット 6選