File size: 606 Bytes
16b18d7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import streamlit as st
import pickle

# Başlık
st.title("🧠 Encrypted Text Classifier (20 Newsgroups)")

# Modeli yükle
with open("cipher_classifier.pkl", "rb") as f:
    vectorizer, model = pickle.load(f)

# Girdi alanı
text = st.text_area("🔐 Enter encrypted (ciphertext) input:", height=200)

if st.button("🧪 Predict"):
    if text.strip() == "":
        st.warning("Lütfen şifreli bir metin girin.")
    else:
        X_input = vectorizer.transform([text])
        prediction = model.predict(X_input)[0]
        st.success(f"📂 Predicted category: **{prediction}**")