Spaces:
Sleeping
Sleeping
File size: 1,145 Bytes
ff9adfe 8850ba6 ff9adfe c855119 311306e c855119 311306e c855119 ff9adfe c855119 ff9adfe c855119 311306e 0593b67 c855119 8850ba6 0593b67 c855119 ff9adfe c855119 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
import streamlit as st
from transformers import pipeline
# App title
st.set_page_config(page_title="Fake Job Detector", page_icon="🕵️♂️")
st.title("Fake Job / Lie Detector")
st.markdown("Enter a job description and check if it seems suspicious!")
# Load small NLI model for zero-shot classification (CPU-friendly)
@st.cache_resource
def load_model():
return pipeline("zero-shot-classification", model="facebook/bart-large-mnli")
classifier = load_model()
# Input from user
job_description = st.text_area("Enter the job description:")
# Label options
labels = ["Legitimate", "Suspicious", "Fake", "Scam"]
# Button to check
if st.button("Check Job"):
if not job_description.strip():
st.warning("Please enter a job description!")
else:
# Run zero-shot classification
results = classifier(job_description, candidate_labels=labels)
st.subheader("Prediction:")
# Show top label and scores
top_label = results["labels"][0]
score = results["scores"][0]
st.success(f"Most likely: **{top_label}** ({score*100:.2f}%)")
st.write("Full results:", results)
|