commit 3fc869132d4e42203c4743c5bf9fd1d492dd7135 Author: FarhanHA442 Date: Wed May 7 10:37:51 2025 +0700 first diff --git a/assets/background.jpg b/assets/background.jpg new file mode 100644 index 0000000..981f1e6 Binary files /dev/null and b/assets/background.jpg differ diff --git a/assets/background.png b/assets/background.png new file mode 100644 index 0000000..0c37767 Binary files /dev/null and b/assets/background.png differ diff --git a/assets/zeopoxa.png b/assets/zeopoxa.png new file mode 100644 index 0000000..c5c38f5 Binary files /dev/null and b/assets/zeopoxa.png differ diff --git a/deteksi_sentimen.php b/deteksi_sentimen.php new file mode 100644 index 0000000..ce20a43 --- /dev/null +++ b/deteksi_sentimen.php @@ -0,0 +1,35 @@ + + + + + + Deteksi Sentimen + + + +
+
+

Deteksi Sentimen Ulasan

+

Aplikasi: Zeopoxa Running

+ +
+ + +
+ + +
+ +
+ termasuk kalimat sentimen + +
+
+ + + + ← Kembali ke Landing Page +
+
+ + diff --git a/index.php b/index.php new file mode 100644 index 0000000..e4dc3f5 --- /dev/null +++ b/index.php @@ -0,0 +1,19 @@ + + + + + Zeopoxa Running + + + +
+
+ +

Apa itu Zeopoxa Running?

+

Zeopoxa Running adalah aplikasi olahraga yang membantu pengguna melacak aktivitas lari mereka, termasuk jarak, kecepatan, dan kalori yang terbakar.

+

Pada website ini, Anda dapat mendeteksi atau mengecek kalimat atau kata yang ingin Anda ketik. Sistem akan mendeteksi apakah kalimat atau kata tersebut termasuk sentimen positif atau negatif.

+ Masuk ke Halaman Deteksi Sentimen +
+
+ + diff --git a/model/sentiment_model.pkl b/model/sentiment_model.pkl new file mode 100644 index 0000000..f906c81 Binary files /dev/null and b/model/sentiment_model.pkl differ diff --git a/model_predict.py b/model_predict.py new file mode 100644 index 0000000..d2be2fa --- /dev/null +++ b/model_predict.py @@ -0,0 +1,16 @@ +import sys +import joblib + +# Ambil input teks dari command line +input_text = sys.argv[1] + +# Load model dan vectorizer dari file +data = joblib.load("model/sentiment_model.pkl") +nb_model = data["model"] +vectorizer = data["vectorizer"] + +# Transformasi input dan prediksi +X_test = vectorizer.transform([input_text]) +y_pred = nb_model.predict(X_test) + +print(y_pred[0]) diff --git a/proses_sentimen.php b/proses_sentimen.php new file mode 100644 index 0000000..12caa91 --- /dev/null +++ b/proses_sentimen.php @@ -0,0 +1,18 @@ +$command"; + exit; + } + + header("Location: deteksi_sentimen.php?hasil=" . urlencode(trim($output)) . "&ulasan=" . urlencode($ulasan)); + exit; +} +?> \ No newline at end of file diff --git a/sentiment_model.pkl b/sentiment_model.pkl new file mode 100644 index 0000000..f906c81 Binary files /dev/null and b/sentiment_model.pkl differ diff --git a/style.css b/style.css new file mode 100644 index 0000000..b6ab99c --- /dev/null +++ b/style.css @@ -0,0 +1,149 @@ +body { + margin: 0; + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; + scroll-behavior: smooth; + background-color: #f4f4f4; +} + +.logo { + max-width: 200px; + margin-bottom: 1rem; +} + +.landing { + min-height: 100vh; + background: linear-gradient(to right, #00c6ff, #0072ff); + display: flex; + justify-content: center; + align-items: center; + text-align: center; + padding: 4rem 2rem; + color: white; +} + +.container { + max-width: 700px; +} + +.scroll-btn { + display: inline-block; + margin-top: 2rem; + padding: 12px 24px; + background-color: #fff; + color: #0072ff; + text-decoration: none; + font-weight: bold; + border-radius: 8px; + transition: background-color 0.3s ease, color 0.3s ease; +} + +.scroll-btn:hover { + background-color: #e0e0e0; + color: #0057cc; +} + +.sentiment { + min-height: 100vh; + background: linear-gradient(to right, #00c6ff, #0072ff); + display: flex; + justify-content: center; + align-items: center; + padding: 3rem; + color: white; +} + +.form-container { + background: white; + padding: 2rem 2.5rem; + border-radius: 15px; + color: black; + width: 100%; + max-width: 420px; + box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2); + text-align: center; +} + +.form-container h2 { + margin-bottom: 0.5rem; + font-size: 1.8rem; +} + +.subtitle { + font-size: 0.95rem; + color: #666; + margin-bottom: 1.5rem; +} + +input[type="text"] { + width: 100%; + padding: 12px; + margin-top: 1rem; + margin-bottom: 1rem; + border: 1px solid #ccc; + border-radius: 7px; + font-size: 1rem; +} + +button { + background-color: #2575fc; + color: white; + padding: 10px 25px; + border: none; + border-radius: 7px; + cursor: pointer; + font-weight: bold; + font-size: 1rem; + transition: background-color 0.3s ease; +} + +button:hover { + background-color: #1a5ed8; +} + +.hasil-box { + margin-top: 1.5rem; + text-align: left; +} + +.hasil-box label { + display: block; + margin-bottom: 0.5rem; + font-weight: bold; +} + +.hasil-box input { + background-color: #f0f0f0; + border: 1px solid #ccc; + color: #333; + padding: 10px; + width: 100%; + border-radius: 7px; + font-size: 1rem; +} + +.back-link { + display: inline-block; + margin-top: 1.5rem; + color: #2575fc; + text-decoration: none; + font-weight: bold; + transition: color 0.3s ease; +} + +.back-link:hover { + color: #1a5ed8; +} + +.hasil-text { + background-color: #f4f4f4; + padding: 12px 16px; + border-radius: 8px; + border: 1px solid #ccc; + font-size: 14px; + line-height: 1.6; + color: #333; + margin-top: 8px; + white-space: pre-wrap; /* agar baris baru tetap tampil */ + word-wrap: break-word; + transition: all 0.3s ease; +}