Views
No views yet
1import joblib
2import re
3
4# Load the model
5pipeline = joblib.load('fake_job_model_pipeline.pkl')
6
7def clean_text(text):
8 text = text.lower()
9 text = re.sub(r'[^a-zA-Z0-9\s]', '', text)
10 return text.strip()
11
12# Predict
13sample_text = "Urgent Hiring for Data Entry. High salary, no experience required."
14cleaned = clean_text(sample_text)
15prediction = pipeline.predict([cleaned])[0]
16probability = pipeline.predict_proba([cleaned])[0][1]
17
18print(f"Is Fraudulent: {bool(prediction)} (Confidence: {probability:.4f})")