changes
This commit is contained in:
parent
7ed72c8c04
commit
5999e82e28
10
README.md
10
README.md
@ -18,9 +18,11 @@
|
||||
## Instalacja
|
||||
1. Sklonuj repozytorium:
|
||||
```bash
|
||||
git clone https://github.com/yourusername/bitsent.git
|
||||
cd bitsent
|
||||
git clone https://github.com/s481877/BitSent.git```
|
||||
cd BitSent/src
|
||||
2. Upewnij się że python jest zainstalowany
|
||||
```python --version```
|
||||
```bash
|
||||
python --version
|
||||
3. Uruchom skrypt z lokalizacji pliku
|
||||
```python main.py```
|
||||
```bash
|
||||
python main.py
|
BIN
podejście2.zip
Normal file
BIN
podejście2.zip
Normal file
Binary file not shown.
Binary file not shown.
@ -1,7 +1,7 @@
|
||||
import pandas as pd
|
||||
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
|
||||
import requests
|
||||
|
||||
import re
|
||||
|
||||
def fetch_bitcoin_price():
|
||||
url = "https://api.coingecko.com/api/v3/simple/price"
|
||||
@ -24,6 +24,13 @@ def load_csv(file_path):
|
||||
print(f"CSV loaded. Columns: {df.columns}")
|
||||
return df
|
||||
|
||||
def clean_text(text):
|
||||
text = re.sub(r'http\S+', '', text)
|
||||
text = re.sub(r'@\w+', '', text)
|
||||
text = re.sub(r'#\w+', '', text)
|
||||
text = re.sub(r'\s+', ' ', text).strip()
|
||||
return text
|
||||
|
||||
def get_sentiment(text):
|
||||
analyzer = SentimentIntensityAnalyzer()
|
||||
sentiment = analyzer.polarity_scores(text)
|
||||
@ -53,6 +60,7 @@ def date_format(df):
|
||||
df['timestamp'] = pd.to_datetime(df['timestamp'], format='%Y-%d-%m %H:%M:%S')
|
||||
df['timestamp'] = df['timestamp'].dt.ceil('2h')
|
||||
df['timestamp'] = df['timestamp'].dt.strftime('%Y-%m-%d %H:%M:%S')
|
||||
df['text'] = df['text'].apply(clean_text)
|
||||
return df
|
||||
|
||||
def btc_data_(date):
|
||||
|
@ -30,6 +30,12 @@
|
||||
],
|
||||
"execution_count": 49
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "markdown",
|
||||
"source": "In this notebook datasets are processed and merged",
|
||||
"id": "8442de414f013864"
|
||||
},
|
||||
{
|
||||
"metadata": {
|
||||
"ExecuteTime": {
|
||||
|
Loading…
Reference in New Issue
Block a user