YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
import React, { useState } from "react"; import { Card, CardContent } from "@/components/ui/card"; import { Input } from "@/components/ui/input"; import { Button } from "@/components/ui/button"; import { Textarea } from "@/components/ui/textarea"; import { motion } from "framer-motion";
export default function MediaCensorshipFilter() { const [articleText, setArticleText] = useState(""); const [result, setResult] = useState(null); const [loading, setLoading] = useState(false);
const handleAnalyze = async () => { setLoading(true); setResult(null);
try {
const response = await fetch("https://api-inference.huggingface.co/models/your-propaganda-model", {
method: "POST",
headers: {
Authorization: `Bearer YOUR_HUGGINGFACE_API_KEY`,
"Content-Type": "application/json",
},
body: JSON.stringify({ inputs: articleText }),
});
const data = await response.json();
setResult(data);
} catch (error) {
console.error("Error analyzing text:", error);
setResult({ error: "Failed to analyze. Please try again later." });
}
setLoading(false);
};
return (
<motion.div initial={{ opacity: 0 }} animate={{ opacity: 1 }} className="w-full max-w-2xl">
);
}
Media Censorship and Propaganda Filter
<Textarea placeholder="Paste news article text here..." value={articleText} onChange={(e) => setArticleText(e.target.value)} rows={8} /> {result && (
{result.error ? (
)}
)}
</motion.div>
{result.error}
) : (Analysis Result:
{JSON.stringify(result, null, 2)}
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support