SentimenX-BTC Package untuk menganalisis sentimen Bitcoin dari teks menggunakan preprocessing, tokenization, dan model machine learning.
Fitur Utama
- Membersihkan teks dari noise seperti tanda baca dan angka.
- Tokenisasi teks dengan padding otomatis.
- Analisis sentimen menggunakan model machine learning terlatih.
- Mendukung klasifikasi sentimen positif dan negatif.
Instalasi Gunakan pip untuk menginstal package ini: pip install sentimentX-btc
How to Use?
1. preprocessing(text)
Deskripsi:
Fungsi ini digunakan untuk membersihkan teks dari simbol atau karakter yang tidak diinginkan, mengubah teks menjadi huruf kecil, dan menghapus kata-kata berhenti (stop words). Fungsi ini mendukung input berupa string, pandas Series, atau list.
Parameter:
text: Input berupa string, pandas Series, atau list teks mentah yang akan diproses.
Output:
- Mengembalikan teks yang telah diproses dalam bentuk pandas Series.
Contoh Penggunaan:
text = "Hello, world! This is a test."
processed_text = preprocessing(text)
print(processed_text)
2. tokenize_and_padding(text, max_len=0)
Deskripsi:
Fungsi ini melakukan tokenisasi (mengubah teks menjadi token angka) dan padding (menyesuaikan panjang token agar seragam). Panjang padding dapat ditentukan secara manual atau dihitung otomatis.
Parameter:
text: Input berupa string, pandas Series, atau list teks yang akan ditokenisasi dan dipad.max_len(opsional): Panjang maksimum padding. Jika 0, panjang akan dihitung otomatis.
Output:
- Mengembalikan numpy array berisi token yang telah dipad.
Contoh Penggunaan:
text = ["This is a test", "Another example"]
padded_sequences = tokenize_and_padding(text)
print(padded_sequences)
3. only_prediction(tokenized)
Deskripsi:
Fungsi ini melakukan prediksi sentimen berdasarkan token yang telah diproses menggunakan model. Hasilnya berupa probabilitas dan label sentimen (positif/negatif).
Parameter:
tokenized: Numpy array atau list token yang telah dipad.
Output:
- DataFrame dengan kolom:
prediction: Probabilitas prediksi.sentiment: Label sentimen (1 = positif, 0 = negatif).
Contoh Penggunaan:
tokenized = [[1, 2, 3, 4], [5, 6, 7, 0]]
result = only_prediction(tokenized)
print(result)
4. full_prediction(text, pad=0)
Deskripsi:
Fungsi ini melakukan proses lengkap mulai dari preprocessing, tokenisasi, padding, hingga prediksi sentimen untuk teks mentah.
Parameter:
text: Input berupa string atau pandas Series yang akan diproses.pad(opsional): Panjang padding. Jika 0, panjang akan dihitung otomatis.
Output:
- DataFrame dengan kolom:
text: Teks yang telah diproses.padded: Token hasil padding.prediction: Probabilitas prediksi.sentiment: Label sentimen (1 = positif, 0 = negatif).
Contoh Penggunaan:
text = "This is a great day!"
result = full_prediction(text)
print(result)
5. detokenized(sequences)
Deskripsi:
Fungsi ini mengubah token angka hasil tokenisasi kembali menjadi teks asli berdasarkan mapping tokenizer.index_word.
Parameter:
sequences: List dua dimensi berisi token angka.
Output:
- List teks hasil detokenisasi.
Contoh Penggunaan:
sequences = [[1, 2, 3, 4], [5, 6, 0, 0]]
detokenized_text = detokenized(sequences)
print(detokenized_text)
Selamat menganalisis! Semoga bermanfaat! 😄
Dependencies Package ini membutuhkan library berikut:
- Python 3.7+
- TensorFlow
- Numpy
- Pandas
- Scikit-learn
- Joblib
Lisensi Project ini dirilis di bawah lisensi MIT.
Kontak Jika memiliki pertanyaan atau feedback, silakan hubungi saya: Komang Nitay Prasaddas Email: nitay06@students.amikom.ac.id
Metadata
Release files for sentimentX-btc 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| sentimentx_btc-0.0.4.tar.gz | 96.1 MB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sentimentX_btc-0.0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 192.2 MB
Release files / sentimentx_btc-0.0.4.tar.gz
| Download URL | sentimentx_btc-0.0.4.tar.gz |
|---|---|
| Size | 96.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f3e6092fde1220515c635c15c676da7361fc355a87e1da18c0bdf8775e440eb8
|
|
BLAKE2b-256 checksum How to use checksums |
ca19a9c69599c3257f7d6df71be6919ae8f4725c660d6154f50c8d1077c08c48
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.4
|
Release files / sentimentX_btc-0.0.4-py3-none-any.whl
| Download URL | sentimentX_btc-0.0.4-py3-none-any.whl |
|---|---|
| Size | 96.1 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d0be9a8054fa71c5b18d5f11281acb3ae460ceb07473ec003ee24e1946b487d9
|
|
BLAKE2b-256 checksum How to use checksums |
3a6913fbd3c83ddeafd414713715754e9fdd411b17a0c4e6402e4dc5845bd0ba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.4
|
Security for sentimentX-btc 0.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.