Spaces:
Runtime error
Runtime error
mdj1412
commited on
Commit
ยท
a2d2569
1
Parent(s):
c1654fa
demo
Browse files- README.md +3 -0
- dataset_creation/nasdaq_data.py +8 -5
README.md
CHANGED
|
@@ -11,6 +11,9 @@ pinned: false
|
|
| 11 |
|
| 12 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
| 13 |
|
|
|
|
|
|
|
|
|
|
| 14 |
# Stock News Analysis
|
| 15 |
|
| 16 |
This project uses Natural Language Processing (NLP) techniques and machine learning models to analyze stock news, extract valuable insights, and provide visualizations to help users make informed investment decisions.
|
|
|
|
| 11 |
|
| 12 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
| 13 |
|
| 14 |
+
|
| 15 |
+
=============
|
| 16 |
+
|
| 17 |
# Stock News Analysis
|
| 18 |
|
| 19 |
This project uses Natural Language Processing (NLP) techniques and machine learning models to analyze stock news, extract valuable insights, and provide visualizations to help users make informed investment decisions.
|
dataset_creation/nasdaq_data.py
CHANGED
|
@@ -50,19 +50,20 @@ def get_list(tickers=nasdaq100_symbols):
|
|
| 50 |
# ์ฃผ์ ๋ฐ์ดํฐ ๊ฐ์ ธ์ค๊ธฐ
|
| 51 |
def get_data(tickers=nasdaq100_symbols, numOfDay=2):#numOfDay: ๋ ์ง ๊ฐ๊ฒฉ
|
| 52 |
output = []
|
|
|
|
| 53 |
|
| 54 |
# ์์ ๋ ์ง ~ ์ต๊ทผ๊น์ง ๋ฐ์ดํฐ ๊ฐ์ ธ์ค๊ธฐ
|
| 55 |
now = datetime.now() # ์ค๋ ๋ ์ง
|
| 56 |
date = now.weekday() # ์์ผ ํ์ธ
|
| 57 |
|
| 58 |
if date == 5: # Saturday
|
| 59 |
-
start_date = datetime(now.year, now.month, now.day, 0, 0) - timedelta(days=numOfDay+4)
|
| 60 |
end_date = datetime(now.year, now.month, now.day, 0, 0)
|
| 61 |
elif date == 6 or date == 0 or date == 1: # Sunday or Monday or Tuesday
|
| 62 |
-
start_date = datetime(now.year, now.month, now.day, 0, 0) - timedelta(days=numOfDay+5)
|
| 63 |
end_date = datetime(now.year, now.month, now.day, 0, 0)
|
| 64 |
else: # Others
|
| 65 |
-
start_date = datetime(now.year, now.month, now.day, 0, 0) - timedelta(days=numOfDay+3)
|
| 66 |
end_date = datetime(now.year, now.month, now.day, 0, 0)
|
| 67 |
|
| 68 |
|
|
@@ -80,8 +81,10 @@ def get_data(tickers=nasdaq100_symbols, numOfDay=2):#numOfDay: ๋ ์ง ๊ฐ๊ฒฉ
|
|
| 80 |
output.append(abc)
|
| 81 |
|
| 82 |
# print("Output : ", output)
|
| 83 |
-
|
| 84 |
-
|
|
|
|
|
|
|
| 85 |
return output
|
| 86 |
|
| 87 |
|
|
|
|
| 50 |
# ์ฃผ์ ๋ฐ์ดํฐ ๊ฐ์ ธ์ค๊ธฐ
|
| 51 |
def get_data(tickers=nasdaq100_symbols, numOfDay=2):#numOfDay: ๋ ์ง ๊ฐ๊ฒฉ
|
| 52 |
output = []
|
| 53 |
+
delta = (numOfDay / 7) * 2
|
| 54 |
|
| 55 |
# ์์ ๋ ์ง ~ ์ต๊ทผ๊น์ง ๋ฐ์ดํฐ ๊ฐ์ ธ์ค๊ธฐ
|
| 56 |
now = datetime.now() # ์ค๋ ๋ ์ง
|
| 57 |
date = now.weekday() # ์์ผ ํ์ธ
|
| 58 |
|
| 59 |
if date == 5: # Saturday
|
| 60 |
+
start_date = datetime(now.year, now.month, now.day, 0, 0) - timedelta(days=numOfDay+4+delta)
|
| 61 |
end_date = datetime(now.year, now.month, now.day, 0, 0)
|
| 62 |
elif date == 6 or date == 0 or date == 1: # Sunday or Monday or Tuesday
|
| 63 |
+
start_date = datetime(now.year, now.month, now.day, 0, 0) - timedelta(days=numOfDay+5+delta)
|
| 64 |
end_date = datetime(now.year, now.month, now.day, 0, 0)
|
| 65 |
else: # Others
|
| 66 |
+
start_date = datetime(now.year, now.month, now.day, 0, 0) - timedelta(days=numOfDay+3+delta)
|
| 67 |
end_date = datetime(now.year, now.month, now.day, 0, 0)
|
| 68 |
|
| 69 |
|
|
|
|
| 81 |
output.append(abc)
|
| 82 |
|
| 83 |
# print("Output : ", output)
|
| 84 |
+
# from IPython import embed; embed()
|
| 85 |
+
if numOfDay != 60 and len(list(output[0].index.values)) < numOfDay:
|
| 86 |
+
print(numOfDay+numOfDay-len(list(output[0].index.values)))
|
| 87 |
+
output = get_data(tickers, numOfDay+numOfDay-len(list(output[0].index.values)))
|
| 88 |
return output
|
| 89 |
|
| 90 |
|