parkerjj commited on
Commit
cfe1a3c
1 Parent(s): 87d40ba

Uploading Model

Browse files
.gitattributes CHANGED
@@ -1,35 +1,2 @@
1
- *.7z filter=lfs diff=lfs merge=lfs -text
2
- *.arrow filter=lfs diff=lfs merge=lfs -text
3
- *.bin filter=lfs diff=lfs merge=lfs -text
4
- *.bz2 filter=lfs diff=lfs merge=lfs -text
5
- *.ckpt filter=lfs diff=lfs merge=lfs -text
6
- *.ftz filter=lfs diff=lfs merge=lfs -text
7
- *.gz filter=lfs diff=lfs merge=lfs -text
8
- *.h5 filter=lfs diff=lfs merge=lfs -text
9
- *.joblib filter=lfs diff=lfs merge=lfs -text
10
- *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
- *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
- *.model filter=lfs diff=lfs merge=lfs -text
13
- *.msgpack filter=lfs diff=lfs merge=lfs -text
14
- *.npy filter=lfs diff=lfs merge=lfs -text
15
- *.npz filter=lfs diff=lfs merge=lfs -text
16
- *.onnx filter=lfs diff=lfs merge=lfs -text
17
- *.ot filter=lfs diff=lfs merge=lfs -text
18
- *.parquet filter=lfs diff=lfs merge=lfs -text
19
- *.pb filter=lfs diff=lfs merge=lfs -text
20
- *.pickle filter=lfs diff=lfs merge=lfs -text
21
- *.pkl filter=lfs diff=lfs merge=lfs -text
22
- *.pt filter=lfs diff=lfs merge=lfs -text
23
- *.pth filter=lfs diff=lfs merge=lfs -text
24
- *.rar filter=lfs diff=lfs merge=lfs -text
25
- *.safetensors filter=lfs diff=lfs merge=lfs -text
26
- saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
- *.tar.* filter=lfs diff=lfs merge=lfs -text
28
- *.tar filter=lfs diff=lfs merge=lfs -text
29
- *.tflite filter=lfs diff=lfs merge=lfs -text
30
- *.tgz filter=lfs diff=lfs merge=lfs -text
31
- *.wasm filter=lfs diff=lfs merge=lfs -text
32
- *.xz filter=lfs diff=lfs merge=lfs -text
33
- *.zip filter=lfs diff=lfs merge=lfs -text
34
- *.zst filter=lfs diff=lfs merge=lfs -text
35
- *tfevents* filter=lfs diff=lfs merge=lfs -text
 
1
+ model/word2vec-google-news-300.model filter=lfs diff=lfs merge=lfs -text
2
+ Target_Model/* filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
.gitignore ADDED
@@ -0,0 +1,210 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ # Model
3
+ logs/
4
+ #Target_Model/
5
+ #model/word*.npy
6
+
7
+ # Byte-compiled / optimized / DLL files
8
+ __pycache__/
9
+ *.py[cod]
10
+ *$py.class
11
+
12
+
13
+ # C extensions
14
+ *.so
15
+
16
+ # Distribution / packaging
17
+ .Python
18
+ build/
19
+ develop-eggs/
20
+ dist/
21
+ downloads/
22
+ eggs/
23
+ .eggs/
24
+ lib/
25
+ lib64/
26
+ parts/
27
+ sdist/
28
+ var/
29
+ wheels/
30
+ share/python-wheels/
31
+ *.egg-info/
32
+ .installed.cfg
33
+ *.egg
34
+ MANIFEST
35
+
36
+ # PyInstaller
37
+ # Usually these files are written by a python script from a template
38
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
39
+ *.manifest
40
+ *.spec
41
+
42
+ # Installer logs
43
+ pip-log.txt
44
+ pip-delete-this-directory.txt
45
+
46
+ # Unit test / coverage reports
47
+ htmlcov/
48
+ .tox/
49
+ .nox/
50
+ .coverage
51
+ .coverage.*
52
+ .cache
53
+ nosetests.xml
54
+ coverage.xml
55
+ *.cover
56
+ *.py,cover
57
+ .hypothesis/
58
+ .pytest_cache/
59
+ cover/
60
+
61
+ # Translations
62
+ *.mo
63
+ *.pot
64
+
65
+ # Django stuff:
66
+ *.log
67
+ local_settings.py
68
+ db.sqlite3
69
+ db.sqlite3-journal
70
+
71
+ # Flask stuff:
72
+ instance/
73
+ .webassets-cache
74
+
75
+ # Scrapy stuff:
76
+ .scrapy
77
+
78
+ # Sphinx documentation
79
+ docs/_build/
80
+
81
+ # PyBuilder
82
+ .pybuilder/
83
+ target/
84
+
85
+ # Jupyter Notebook
86
+ .ipynb_checkpoints
87
+
88
+ # IPython
89
+ profile_default/
90
+ ipython_config.py
91
+
92
+ # pyenv
93
+ # For a library or package, you might want to ignore these files since the code is
94
+ # intended to run in multiple environments; otherwise, check them in:
95
+ # .python-version
96
+
97
+ # pipenv
98
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
99
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
100
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
101
+ # install all needed dependencies.
102
+ #Pipfile.lock
103
+
104
+ # poetry
105
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
106
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
107
+ # commonly ignored for libraries.
108
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
109
+ #poetry.lock
110
+
111
+ # pdm
112
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
113
+ #pdm.lock
114
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
115
+ # in version control.
116
+ # https://pdm.fming.dev/latest/usage/project/#working-with-version-control
117
+ .pdm.toml
118
+ .pdm-python
119
+ .pdm-build/
120
+
121
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
122
+ __pypackages__/
123
+
124
+ # Celery stuff
125
+ celerybeat-schedule
126
+ celerybeat.pid
127
+
128
+ # SageMath parsed files
129
+ *.sage.py
130
+
131
+ # Environments
132
+ .env
133
+ .venv
134
+ env/
135
+ venv/
136
+ ENV/
137
+ env.bak/
138
+ venv.bak/
139
+
140
+ # Spyder project settings
141
+ .spyderproject
142
+ .spyproject
143
+
144
+ # Rope project settings
145
+ .ropeproject
146
+
147
+ # mkdocs documentation
148
+ /site
149
+
150
+ # mypy
151
+ .mypy_cache/
152
+ .dmypy.json
153
+ dmypy.json
154
+
155
+ # Pyre type checker
156
+ .pyre/
157
+
158
+ # pytype static type analyzer
159
+ .pytype/
160
+
161
+ # Cython debug symbols
162
+ cython_debug/
163
+
164
+ # PyCharm
165
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
166
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
167
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
168
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
169
+ #.idea/
170
+
171
+ # General
172
+ .DS_Store
173
+ .AppleDouble
174
+ .LSOverride
175
+
176
+ # Icon must end with two \r
177
+ Icon
178
+
179
+
180
+ # Thumbnails
181
+ ._*
182
+
183
+ # Files that might appear in the root of a volume
184
+ .DocumentRevisions-V100
185
+ .fseventsd
186
+ .Spotlight-V100
187
+ .TemporaryItems
188
+ .Trashes
189
+ .VolumeIcon.icns
190
+ .com.apple.timemachine.donotpresent
191
+
192
+ # Directories potentially created on remote AFP share
193
+ .AppleDB
194
+ .AppleDesktop
195
+ Network Trash Folder
196
+ Temporary Items
197
+ .apdisk
198
+
199
+ .vscode/*
200
+ !.vscode/settings.json
201
+ !.vscode/tasks.json
202
+ !.vscode/launch.json
203
+ !.vscode/extensions.json
204
+ !.vscode/*.code-snippets
205
+
206
+ # Local History for Visual Studio Code
207
+ .history/
208
+
209
+ # Built Visual Studio Code Extensions
210
+ *.vsix
.vscode/settings.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "git.ignoreLimitWarning": true,
3
+ "python.analysis.autoImportCompletions": true
4
+ }
app.py CHANGED
@@ -1,20 +1,25 @@
1
- import streamlit as st
2
- import requests
 
3
 
4
- # Streamlit 页面设置
5
- st.title('AI Model API Interface')
6
- st.write('输入文本,获取模型预测结果。')
7
 
8
- # 用户输入
9
- user_input = st.text_area('请输入文本:')
 
10
 
11
- if st.button('提交'):
12
- if user_input.strip():
13
- with st.spinner('正在预测...'):
14
- try:
15
- prediction = user_input + '123'
16
- st.success(f'预测结果: {prediction}')
17
- except Exception as e:
18
- st.error(f'请求失败: {e}')
19
- else:
20
- st.warning('请输入文本!')
 
 
 
 
 
1
+ from fastapi import FastAPI, HTTPException
2
+ from pydantic import BaseModel
3
+ #from preprocess import preprocess_text
4
 
5
+ # 初始化 FastAPI 应用
6
+ app = FastAPI()
 
7
 
8
+ # 定义请求体模型
9
+ class TextRequest(BaseModel):
10
+ text: str
11
 
12
+ @app.post("/api/preprocess")
13
+ async def api_preprocess(request: TextRequest):
14
+ """
15
+ API: 接收新闻文本,返回预处理结果。
16
+ """
17
+ if not request.text.strip():
18
+ raise HTTPException(status_code=400, detail="Text cannot be empty.")
19
+ result = request.text + 'ABC'
20
+ return result
21
+
22
+ # 启动服务
23
+ if __name__ == "__main__":
24
+ import uvicorn
25
+ uvicorn.run(app, host="0.0.0.0", port=8000)
app/__init__.py DELETED
@@ -1,7 +0,0 @@
1
- from flask import Flask
2
-
3
- def create_app():
4
- app = Flask(__name__)
5
- from .routes import api
6
- app.register_blueprint(api)
7
- return app
 
 
 
 
 
 
 
 
app/model.py DELETED
@@ -1,11 +0,0 @@
1
- from transformers import pipeline
2
-
3
- # 加载模型
4
- #model = pipeline('text-classification')
5
-
6
- def predict(text):
7
- try:
8
- result = text + ' is a good movie'
9
- return result
10
- except Exception as e:
11
- return {'error': str(e)}
 
 
 
 
 
 
 
 
 
 
 
 
app/routes.py DELETED
@@ -1,12 +0,0 @@
1
- from flask import Blueprint, request, jsonify
2
- from .model import predict
3
-
4
- api = Blueprint('api', __name__)
5
-
6
- @api.route('/predict', methods=['POST'])
7
- def predict_route():
8
- data = request.get_json()
9
- if not data or 'input' not in data:
10
- return jsonify({'error': 'Invalid input'}), 400
11
- prediction = predict(data['input'])
12
- return jsonify({'prediction': prediction})
 
 
 
 
 
 
 
 
 
 
 
 
 
model/dji.csv ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Company,Exchange,Symbol,Industry
2
+ 3M,NYSE,MMM,Conglomerate
3
+ American Express,NYSE,AXP,Financial services
4
+ Amgen,NASDAQ,AMGN,Biopharmaceutical
5
+ Amazon,NASDAQ,AMZN,Retailing
6
+ Apple,NASDAQ,AAPL,Information technology
7
+ Boeing,NYSE,BA,Aerospace�and�defense
8
+ Caterpillar,NYSE,CAT,Construction�and�mining
9
+ Chevron,NYSE,CVX,Petroleum industry
10
+ Cisco,NASDAQ,CSCO,Information technology
11
+ Coca-Cola,NYSE,KO,Drink industry
12
+ Disney,NYSE,DIS,Broadcasting�and�entertainment
13
+ Dow,NYSE,DOW,Chemical industry
14
+ Goldman Sachs,NYSE,GS,Financial services
15
+ Home Depot,NYSE,HD,Home Improvement
16
+ Honeywell,NASDAQ,HON,Conglomerate
17
+ IBM,NYSE,IBM,Information technology
18
+ Intel,NASDAQ,INTC,Semiconductor industry
19
+ Johnson & Johnson,NYSE,JNJ,Pharmaceutical industry
20
+ JPMorgan Chase,NYSE,JPM,Financial services
21
+ McDonald's,NYSE,MCD,Food industry
22
+ Merck,NYSE,MRK,Pharmaceutical industry
23
+ Microsoft,NASDAQ,MSFT,Information technology
24
+ Nike,NYSE,NKE,Clothing industry
25
+ Procter & Gamble,NYSE,PG,Fast-moving consumer goods
26
+ Salesforce,NYSE,CRM,Information technology
27
+ Travelers,NYSE,TRV,Insurance
28
+ UnitedHealth Group,NYSE,UNH,Managed health care
29
+ Verizon,NYSE,VZ,Telecommunications industry
30
+ Visa,NYSE,V,Financial services
31
+ Walmart,NYSE,WMT,Retailing
model/nasdaq100.csv ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Symbol,Name
2
+ AAPL,Apple Inc. Common Stock
3
+ ABNB,"Airbnb, Inc. Class A Common Stock"
4
+ ADBE,Adobe Inc. Common Stock
5
+ ADI,"Analog Devices, Inc. Common Stock"
6
+ ADP,"Automatic Data Processing, Inc. Common Stock"
7
+ ADSK,"Autodesk, Inc. Common Stock"
8
+ AEP,"American Electric Power Company, Inc. Common Stock"
9
+ AMAT,"Applied Materials, Inc. Common Stock"
10
+ AMD,"Advanced Micro Devices, Inc. Common Stock"
11
+ AMGN,Amgen Inc. Common Stock
12
+ AMZN,"Amazon.com, Inc. Common Stock"
13
+ ANSS,"ANSYS, Inc. Common Stock"
14
+ ARM,Arm Holdings plc American Depositary Shares
15
+ ASML,ASML Holding N.V. New York Registry Shares
16
+ AVGO,Broadcom Inc. Common Stock
17
+ AZN,AstraZeneca PLC American Depositary Shares
18
+ BIIB,Biogen Inc. Common Stock
19
+ BKNG,Booking Holdings Inc. Common Stock
20
+ BKR,Baker Hughes Company Class A Common Stock
21
+ CCEP,Coca-Cola Europacific Partners plc Ordinary Shares
22
+ CDNS,"Cadence Design Systems, Inc. Common Stock"
23
+ CDW,CDW Corporation Common Stock
24
+ CEG,Constellation Energy Corporation Common Stock
25
+ CHTR,"Charter Communications, Inc. Class A Common Stock New"
26
+ CMCSA,Comcast Corporation Class A Common Stock
27
+ COST,Costco Wholesale Corporation Common Stock
28
+ CPRT,"Copart, Inc. (DE) Common Stock"
29
+ CRWD,"CrowdStrike Holdings, Inc. Class A Common Stock"
30
+ CSCO,"Cisco Systems, Inc. Common Stock (DE)"
31
+ CSGP,"CoStar Group, Inc. Common Stock"
32
+ CSX,CSX Corporation Common Stock
33
+ CTAS,Cintas Corporation Common Stock
34
+ CTSH,Cognizant Technology Solutions Corporation Class A Common Stock
35
+ DASH,"DoorDash, Inc. Class A Common Stock"
36
+ DDOG,"Datadog, Inc. Class A Common Stock"
37
+ DLTR,Dollar Tree Inc. Common Stock
38
+ DXCM,"DexCom, Inc. Common Stock"
39
+ EA,Electronic Arts Inc. Common Stock
40
+ EXC,Exelon Corporation Common Stock
41
+ FANG,"Diamondback Energy, Inc. Common Stock"
42
+ FAST,Fastenal Company Common Stock
43
+ FTNT,"Fortinet, Inc. Common Stock"
44
+ GEHC,GE HealthCare Technologies Inc. Common Stock
45
+ GFS,GlobalFoundries Inc. Ordinary Shares
46
+ GILD,"Gilead Sciences, Inc. Common Stock"
47
+ GOOG,Alphabet Inc. Class C Capital Stock
48
+ GOOGL,Alphabet Inc. Class A Common Stock
49
+ HON,Honeywell International Inc. Common Stock
50
+ IDXX,"IDEXX Laboratories, Inc. Common Stock"
51
+ ILMN,"Illumina, Inc. Common Stock"
52
+ INTC,Intel Corporation Common Stock
53
+ INTU,Intuit Inc. Common Stock
54
+ ISRG,"Intuitive Surgical, Inc. Common Stock"
55
+ KDP,Keurig Dr Pepper Inc. Common Stock
56
+ KHC,The Kraft Heinz Company Common Stock
57
+ KLAC,KLA Corporation Common Stock
58
+ LIN,Linde plc Ordinary Shares
59
+ LRCX,Lam Research Corporation Common Stock
60
+ LULU,lululemon athletica inc. Common Stock
61
+ MAR,Marriott International Class A Common Stock
62
+ MCHP,Microchip Technology Incorporated Common Stock
63
+ MDB,"MongoDB, Inc. Class A Common Stock"
64
+ MDLZ,"Mondelez International, Inc. Class A Common Stock"
65
+ MELI,"MercadoLibre, Inc. Common Stock"
66
+ META,"Meta Platforms, Inc. Class A Common Stock"
67
+ MNST,Monster Beverage Corporation
68
+ MRNA,"Moderna, Inc. Common Stock"
69
+ MRVL,"Marvell Technology, Inc. Common Stock"
70
+ MSFT,Microsoft Corporation Common Stock
71
+ MU,"Micron Technology, Inc. Common Stock"
72
+ NFLX,"Netflix, Inc. Common Stock"
73
+ NVDA,NVIDIA Corporation Common Stock
74
+ NXPI,NXP Semiconductors N.V. Common Stock
75
+ ODFL,"Old Dominion Freight Line, Inc. Common Stock"
76
+ ON,ON Semiconductor Corporation Common Stock
77
+ ORLY,"O'Reilly Automotive, Inc. Common Stock"
78
+ PANW,"Palo Alto Networks, Inc. Common Stock"
79
+ PAYX,"Paychex, Inc. Common Stock"
80
+ PCAR,PACCAR Inc. Common Stock
81
+ PDD,PDD Holdings Inc. American Depositary Shares
82
+ PEP,"PepsiCo, Inc. Common Stock"
83
+ PYPL,"PayPal Holdings, Inc. Common Stock"
84
+ QCOM,QUALCOMM Incorporated Common Stock
85
+ REGN,"Regeneron Pharmaceuticals, Inc. Common Stock"
86
+ ROP,"Roper Technologies, Inc. Common Stock"
87
+ ROST,"Ross Stores, Inc. Common Stock"
88
+ SBUX,Starbucks Corporation Common Stock
89
+ SMCI,"Super Micro Computer, Inc. Common Stock"
90
+ SNPS,"Synopsys, Inc. Common Stock"
91
+ TEAM,Atlassian Corporation Class A Common Stock
92
+ TMUS,"T-Mobile US, Inc. Common Stock"
93
+ TSLA,"Tesla, Inc. Common Stock"
94
+ TTD,"The Trade Desk, Inc. Class A Common Stock"
95
+ TTWO,"Take-Two Interactive Software, Inc. Common Stock"
96
+ TXN,Texas Instruments Incorporated Common Stock
97
+ VRSK,"Verisk Analytics, Inc. Common Stock"
98
+ VRTX,Vertex Pharmaceuticals Incorporated Common Stock
99
+ WBD,"Warner Bros. Discovery, Inc. Series A Common Stock"
100
+ WDAY,"Workday, Inc. Class A Common Stock"
101
+ XEL,Xcel Energy Inc. Common Stock
102
+ ZS,"Zscaler, Inc. Common Stock"
model/nasdaq_all.csv ADDED
The diff for this file is too large to render. See raw diff
 
model/sp500.csv ADDED
@@ -0,0 +1,504 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Symbol,Security,GICS Sector,GICS Sub-Industry,Headquarters Location,Date added,CIK,Founded
2
+ A,Agilent Technologies,Health Care,Life Sciences Tools & Services,"Santa Clara, California",2000-06-05,1090872,1999
3
+ AAL,American Airlines Group,Industrials,Passenger Airlines,"Fort Worth, Texas",2015-03-23,6201,1934
4
+ AAPL,Apple Inc.,Information Technology,"Technology Hardware, Storage & Peripherals","Cupertino, California",1982-11-30,320193,1977
5
+ ABBV,AbbVie,Health Care,Biotechnology,"North Chicago, Illinois",2012-12-31,1551152,2013 (1888)
6
+ ABNB,Airbnb,Consumer Discretionary,"Hotels, Resorts & Cruise Lines","San Francisco, California",2023-09-18,1559720,2008
7
+ ABT,Abbott,Health Care,Health Care Equipment,"North Chicago, Illinois",1957-03-04,1800,1888
8
+ ACGL,Arch Capital Group,Financials,Property & Casualty Insurance,"Hamilton, Bermuda",2022-11-01,947484,1995
9
+ ACN,Accenture,Information Technology,IT Consulting & Other Services,"Dublin, Ireland",2011-07-06,1467373,1989
10
+ ADBE,Adobe Inc.,Information Technology,Application Software,"San Jose, California",1997-05-05,796343,1982
11
+ ADI,Analog Devices,Information Technology,Semiconductors,"Wilmington, Massachusetts",1999-10-12,6281,1965
12
+ ADM,Archer-Daniels-Midland,Consumer Staples,Agricultural Products & Services,"Chicago, Illinois",1957-03-04,7084,1902
13
+ ADP,Automated Data Processing,Industrials,Human Resource & Employment Services,"Roseland, New Jersey",1981-03-31,8670,1949
14
+ ADSK,Autodesk,Information Technology,Application Software,"San Francisco, California",1989-12-01,769397,1982
15
+ AEE,Ameren,Utilities,Multi-Utilities,"St. Louis, Missouri",1991-09-19,1002910,1902
16
+ AEP,American Electric Power,Utilities,Electric Utilities,"Columbus, Ohio",1957-03-04,4904,1906
17
+ AES,AES Corporation,Utilities,Independent Power Producers & Energy Traders,"Arlington, Virginia",1998-10-02,874761,1981
18
+ AFL,Aflac,Financials,Life & Health Insurance,"Columbus, Georgia",1999-05-28,4977,1955
19
+ AIG,American International Group,Financials,Multi-line Insurance,"New York City, New York",1980-03-31,5272,1919
20
+ AIZ,Assurant,Financials,Multi-line Insurance,"Atlanta, Georgia",2007-04-10,1267238,1892
21
+ AJG,Arthur J. Gallagher & Co.,Financials,Insurance Brokers,"Rolling Meadows, Illinois",2016-05-31,354190,1927
22
+ AKAM,Akamai,Information Technology,Internet Services & Infrastructure,"Cambridge, Massachusetts",2007-07-12,1086222,1998
23
+ ALB,Albemarle Corporation,Materials,Specialty Chemicals,"Charlotte, North Carolina",2016-07-01,915913,1994
24
+ ALGN,Align Technology,Health Care,Health Care Supplies,"Tempe, Arizona",2017-06-19,1097149,1997
25
+ ALL,Allstate,Financials,Property & Casualty Insurance,"Northbrook, Illinois",1995-07-13,899051,1931
26
+ ALLE,Allegion,Industrials,Building Products,"Dublin, Ireland",2013-12-02,1579241,1908
27
+ AMAT,Applied Materials,Information Technology,Semiconductor Materials & Equipment,"Santa Clara, California",1995-03-16,6951,1967
28
+ AMCR,Amcor,Materials,Paper & Plastic Packaging Products & Materials,"Warmley, Bristol, United Kingdom",2019-06-07,1748790,2019 (1860)
29
+ AMD,Advanced Micro Devices,Information Technology,Semiconductors,"Santa Clara, California",2017-03-20,2488,1969
30
+ AME,Ametek,Industrials,Electrical Components & Equipment,"Berwyn, Pennsylvania",2013-09-23,1037868,1930
31
+ AMGN,Amgen,Health Care,Biotechnology,"Thousand Oaks, California",1992-01-02,318154,1980
32
+ AMP,Ameriprise Financial,Financials,Asset Management & Custody Banks,"Minneapolis, Minnesota",2005-10-03,820027,1894
33
+ AMT,American Tower,Real Estate,Telecom Tower REITs,"Boston, Massachusetts",2007-11-19,1053507,1995
34
+ AMZN,Amazon,Consumer Discretionary,Broadline Retail,"Seattle, Washington",2005-11-18,1018724,1994
35
+ ANET,Arista Networks,Information Technology,Communications Equipment,"Santa Clara, California",2018-08-28,1596532,2004
36
+ ANSS,Ansys,Information Technology,Application Software,"Canonsburg, Pennsylvania",2017-06-19,1013462,1969
37
+ AON,Aon,Financials,Insurance Brokers,"London, UK",1996-04-23,315293,1982 (1919)
38
+ AOS,A. O. Smith,Industrials,Building Products,"Milwaukee, Wisconsin",2017-07-26,91142,1916
39
+ APA,APA Corporation,Energy,Oil & Gas Exploration & Production,"Houston, Texas",1997-07-28,1841666,1954
40
+ APD,Air Products and Chemicals,Materials,Industrial Gases,"Allentown, Pennsylvania",1985-04-30,2969,1940
41
+ APH,Amphenol,Information Technology,Electronic Components,"Wallingford, Connecticut",2008-09-30,820313,1932
42
+ APTV,Aptiv,Consumer Discretionary,Automotive Parts & Equipment,"Dublin, Ireland",2012-12-24,1521332,1994
43
+ ARE,Alexandria Real Estate Equities,Real Estate,Office REITs,"Pasadena, California",2017-03-20,1035443,1994
44
+ ATO,Atmos Energy,Utilities,Gas Utilities,"Dallas, Texas",2019-02-15,731802,1906
45
+ AVB,AvalonBay Communities,Real Estate,Multi-Family Residential REITs,"Arlington, Virginia",2007-01-10,915912,1978
46
+ AVGO,Broadcom Inc.,Information Technology,Semiconductors,"Palo Alto, California",2014-05-08,1730168,1961
47
+ AVY,Avery Dennison,Materials,Paper & Plastic Packaging Products & Materials,"Mentor, Ohio",1987-12-31,8818,1990
48
+ AWK,American Water Works,Utilities,Water Utilities,"Camden, New Jersey",2016-03-04,1410636,1886
49
+ AXON,Axon Enterprise,Industrials,Aerospace & Defense,"Scottsdale, Arizona",2023-05-04,1069183,1993
50
+ AXP,American Express,Financials,Consumer Finance,"New York City, New York",1976-06-30,4962,1850
51
+ AZO,AutoZone,Consumer Discretionary,Automotive Retail,"Memphis, Tennessee",1997-01-02,866787,1979
52
+ BA,Boeing,Industrials,Aerospace & Defense,"Arlington, Virginia",1957-03-04,12927,1916
53
+ BAC,Bank of America,Financials,Diversified Banks,"Charlotte, North Carolina",1976-06-30,70858,1998 (1923 / 1874)
54
+ BALL,Ball Corporation,Materials,"Metal, Glass & Plastic Containers","Broomfield, Colorado",1984-10-31,9389,1880
55
+ BAX,Baxter International,Health Care,Health Care Equipment,"Deerfield, Illinois",1972-09-30,10456,1931
56
+ BBWI,"Bath & Body Works, Inc.",Consumer Discretionary,Other Specialty Retail,"Columbus, Ohio",1983-09-30,701985,1963
57
+ BBY,Best Buy,Consumer Discretionary,Computer & Electronics Retail,"Richfield, Minnesota",1999-06-29,764478,1966
58
+ BDX,Becton Dickinson,Health Care,Health Care Equipment,"Franklin Lakes, New Jersey",1972-09-30,10795,1897
59
+ BEN,Franklin Templeton,Financials,Asset Management & Custody Banks,"San Mateo, California",1998-04-30,38777,1947
60
+ BF.B,Brown–Forman,Consumer Staples,Distillers & Vintners,"Louisville, Kentucky",1982-10-31,14693,1870
61
+ BG,Bunge Global SA,Consumer Staples,Agricultural Products & Services,"Chesterfield, Missouri",2023-03-15,1996862,1818
62
+ BIIB,Biogen,Health Care,Biotechnology,"Cambridge, Massachusetts",2003-11-13,875045,1978
63
+ BIO,Bio-Rad,Health Care,Life Sciences Tools & Services,"Hercules, California",2020-06-22,12208,1952
64
+ BK,Bank of New York Mellon,Financials,Asset Management & Custody Banks,"New York City, New York",1995-03-31,1390777,1784
65
+ BKNG,Booking Holdings,Consumer Discretionary,"Hotels, Resorts & Cruise Lines","Norwalk, Connecticut",2009-11-06,1075531,1996
66
+ BKR,Baker Hughes,Energy,Oil & Gas Equipment & Services,"Houston, Texas",2017-07-07,1701605,2017
67
+ BLDR,Builders FirstSource,Industrials,Building Products,"Irving, Texas",2023-12-18,1316835,1998
68
+ BLK,BlackRock,Financials,Asset Management & Custody Banks,"New York City, New York",2011-04-04,1364742,1988
69
+ BMY,Bristol Myers Squibb,Health Care,Pharmaceuticals,"New York City, New York",1957-03-04,14272,1989 (1887)
70
+ BR,Broadridge Financial Solutions,Industrials,Data Processing & Outsourced Services,"Lake Success, New York",2018-06-18,1383312,1962
71
+ BRK.B,Berkshire Hathaway,Financials,Multi-Sector Holdings,"Omaha, Nebraska",2010-02-16,1067983,1839
72
+ BRO,Brown & Brown,Financials,Insurance Brokers,"Daytona Beach, Florida",2021-09-20,79282,1939
73
+ BSX,Boston Scientific,Health Care,Health Care Equipment,"Marlborough, Massachusetts",1995-02-24,885725,1979
74
+ BWA,BorgWarner,Consumer Discretionary,Automotive Parts & Equipment,"Auburn Hills, Michigan",2011-12-19,908255,1880
75
+ BX,Blackstone,Financials,Asset Management & Custody Banks,"New York City, New York",2023-09-18,1393818,1985
76
+ BXP,Boston Properties,Real Estate,Office REITs,"Boston, Massachusetts",2006-04-03,1037540,1970
77
+ C,Citigroup,Financials,Diversified Banks,"New York City, New York",1988-05-31,831001,1998
78
+ CAG,Conagra Brands,Consumer Staples,Packaged Foods & Meats,"Chicago, Illinois",1983-08-31,23217,1919
79
+ CAH,Cardinal Health,Health Care,Health Care Distributors,"Dublin, Ohio",1997-05-27,721371,1971
80
+ CARR,Carrier Global,Industrials,Building Products,"Palm Beach Gardens, Florida",2020-04-03,1783180,"2020 (1915, United Technologies spinoff)"
81
+ CAT,Caterpillar Inc.,Industrials,Construction Machinery & Heavy Transportation Equipment,"Irving, Texas",1957-03-04,18230,1925
82
+ CB,Chubb Limited,Financials,Property & Casualty Insurance,"Zurich, Switzerland",2010-07-15,896159,1985
83
+ CBOE,Cboe Global Markets,Financials,Financial Exchanges & Data,"Chicago, Illinois",2017-03-01,1374310,1973
84
+ CBRE,CBRE Group,Real Estate,Real Estate Services,"Dallas, Texas",2006-11-10,1138118,1906
85
+ CCI,Crown Castle,Real Estate,Telecom Tower REITs,"Houston, Texas",2012-03-14,1051470,1994
86
+ CCL,Carnival,Consumer Discretionary,"Hotels, Resorts & Cruise Lines","Miami, Florida",1998-12-22,815097,1972
87
+ CDNS,Cadence Design Systems,Information Technology,Application Software,"San Jose, California",2017-09-18,813672,1988
88
+ CDW,CDW,Information Technology,Technology Distributors,"Lincolnshire, Illinois",2019-09-23,1402057,1984
89
+ CE,Celanese,Materials,Specialty Chemicals,"Irving, Texas",2018-12-24,1306830,1918
90
+ CEG,Constellation Energy,Utilities,Electric Utilities,"Baltimore, Maryland",2022-02-02,1868275,1999
91
+ CF,CF Industries,Materials,Fertilizers & Agricultural Chemicals,"Deerfield, Illinois",2008-08-27,1324404,1946
92
+ CFG,Citizens Financial Group,Financials,Regional Banks,"Providence, Rhode Island",2016-01-29,759944,1828
93
+ CHD,Church & Dwight,Consumer Staples,Household Products,"Ewing, New Jersey",2015-12-29,313927,1847
94
+ CHRW,CH Robinson,Industrials,Air Freight & Logistics,"Eden Prairie, Minnesota",2007-03-02,1043277,1905
95
+ CHTR,Charter Communications,Communication Services,Cable & Satellite,"Stamford, Connecticut",2016-09-08,1091667,1993
96
+ CI,Cigna,Health Care,Health Care Services,"Bloomfield, Connecticut",1976-06-30,1739940,1982
97
+ CINF,Cincinnati Financial,Financials,Property & Casualty Insurance,"Fairfield, Ohio",1997-12-18,20286,1950
98
+ CL,Colgate-Palmolive,Consumer Staples,Household Products,"New York City, New York",1957-03-04,21665,1806
99
+ CLX,Clorox,Consumer Staples,Household Products,"Oakland, California",1969-03-31,21076,1913
100
+ CMA,Comerica,Financials,Diversified Banks,"Dallas, Texas",1995-12-01,28412,1849
101
+ CMCSA,Comcast,Communication Services,Cable & Satellite,"Philadelphia, Pennsylvania",2002-11-19,1166691,1963
102
+ CME,CME Group,Financials,Financial Exchanges & Data,"Chicago, Illinois",2006-08-11,1156375,1848
103
+ CMG,Chipotle Mexican Grill,Consumer Discretionary,Restaurants,"Newport Beach, California",2011-04-28,1058090,1993
104
+ CMI,Cummins,Industrials,Construction Machinery & Heavy Transportation Equipment,"Columbus, Indiana",1965-03-31,26172,1919
105
+ CMS,CMS Energy,Utilities,Multi-Utilities,"Jackson, Michigan",1957-03-04,811156,1886
106
+ CNC,Centene Corporation,Health Care,Managed Health Care,"St. Louis, Missouri",2016-03-30,1071739,1984
107
+ CNP,CenterPoint Energy,Utilities,Multi-Utilities,"Houston, Texas",1985-07-31,1130310,1882
108
+ COF,Capital One,Financials,Consumer Finance,"Tysons Corner, Virginia",1998-07-01,927628,1994
109
+ COO,CooperCompanies,Health Care,Health Care Supplies,"San Ramon, California",2016-09-23,711404,1958
110
+ COP,ConocoPhillips,Energy,Oil & Gas Exploration & Production,"Houston, Texas",1957-03-04,1163165,2002
111
+ COR,Cencora,Health Care,Health Care Distributors,"Conshohocken, Pennsylvania",2001-08-30,1140859,1985
112
+ COST,Costco,Consumer Staples,Consumer Staples Merchandise Retail,"Issaquah, Washington",1993-10-01,909832,1976
113
+ CPB,Campbell Soup Company,Consumer Staples,Packaged Foods & Meats,"Camden, New Jersey",1957-03-04,16732,1869
114
+ CPRT,Copart,Industrials,Diversified Support Services,"Dallas, Texas",2018-07-02,900075,1982
115
+ CPT,Camden Property Trust,Real Estate,Multi-Family Residential REITs,"Houston, Texas",2022-04-04,906345,1981
116
+ CRL,Charles River Laboratories,Health Care,Life Sciences Tools & Services,"Wilmington, Massachusetts",2021-05-14,1100682,1947
117
+ CRM,Salesforce,Information Technology,Application Software,"San Francisco, California",2008-09-15,1108524,1999
118
+ CSCO,Cisco,Information Technology,Communications Equipment,"San Jose, California",1993-12-01,858877,1984
119
+ CSGP,CoStar Group,Real Estate,Real Estate Services,"Washington, D.C.",2022-09-19,1057352,1987
120
+ CSX,CSX,Industrials,Rail Transportation,"Jacksonville, Florida",1957-03-04,277948,1980
121
+ CTAS,Cintas,Industrials,Diversified Support Services,"Mason, Ohio",2001-03-01,723254,1929
122
+ CTLT,Catalent,Health Care,Pharmaceuticals,"Somerset, New Jersey",2020-09-21,1596783,2007
123
+ CTRA,Coterra,Energy,Oil & Gas Exploration & Production,"Houston, Texas",2008-06-23,858470,2021 (1989)
124
+ CTSH,Cognizant,Information Technology,IT Consulting & Other Services,"Teaneck, New Jersey",2006-11-17,1058290,1994
125
+ CTVA,Corteva,Materials,Fertilizers & Agricultural Chemicals,"Indianapolis, Indiana",2019-06-03,1755672,2019
126
+ CVS,CVS Health,Health Care,Health Care Services,"Woonsocket, Rhode Island",1957-03-04,64803,1996
127
+ CVX,Chevron Corporation,Energy,Integrated Oil & Gas,"San Ramon, California",1957-03-04,93410,1879
128
+ CZR,Caesars Entertainment,Consumer Discretionary,Casinos & Gaming,"Reno, Nevada",2021-03-22,1590895,1973
129
+ D,Dominion Energy,Utilities,Multi-Utilities,"Richmond, Virginia",2016-11-30,715957,1983
130
+ DAL,Delta Air Lines,Industrials,Passenger Airlines,"Atlanta, Georgia",2013-09-11,27904,1929
131
+ DAY,Dayforce,Industrials,Human Resource & Employment Services,"Minneapolis, Minnesota",2021-09-20,1725057,1992
132
+ DD,DuPont,Materials,Specialty Chemicals,"Wilmington, Delaware",2019-04-02,1666700,2017 (1802)
133
+ DE,John Deere,Industrials,Agricultural & Farm Machinery,"Moline, Illinois",1957-03-04,315189,1837
134
+ DECK,Deckers Brands,Consumer Discretionary,Footwear,"Goleta, California",2024-03-01,910521,1973
135
+ DFS,Discover Financial,Financials,Consumer Finance,"Riverwoods, Illinois",2007-07-02,1393612,1985
136
+ DG,Dollar General,Consumer Staples,Consumer Staples Merchandise Retail,"Goodlettsville, Tennessee",2012-12-03,29534,1939
137
+ DGX,Quest Diagnostics,Health Care,Health Care Services,"Secaucus, New Jersey",2002-12-12,1022079,1967
138
+ DHI,DR Horton,Consumer Discretionary,Homebuilding,"Arlington, Texas",2005-06-22,882184,1978
139
+ DHR,Danaher Corporation,Health Care,Life Sciences Tools & Services,"Washington, D.C.",1998-11-18,313616,1969
140
+ DIS,Walt Disney,Communication Services,Movies & Entertainment,"Burbank, California",1976-06-30,1744489,1923
141
+ DLR,Digital Realty,Real Estate,Data Center REITs,"Austin, Texas",2016-05-18,1297996,2004
142
+ DLTR,Dollar Tree,Consumer Staples,Consumer Staples Merchandise Retail,"Chesapeake, Virginia",2011-12-19,935703,1986
143
+ DOC,Healthpeak,Real Estate,Health Care REITs,"Denver, Colorado",2008-03-31,765880,1985
144
+ DOV,Dover Corporation,Industrials,Industrial Machinery & Supplies & Components,"Downers Grove, Illinois",1985-10-31,29905,1955
145
+ DOW,Dow Inc.,Materials,Commodity Chemicals,"Midland, Michigan",2019-04-01,1751788,2019 (1897)
146
+ DPZ,Domino's,Consumer Discretionary,Restaurants,"Ann Arbor, Michigan",2020-05-12,1286681,1960
147
+ DRI,Darden Restaurants,Consumer Discretionary,Restaurants,"Orlando, Florida",1995-05-31,940944,1938
148
+ DTE,DTE Energy,Utilities,Multi-Utilities,"Detroit, Michigan",1957-03-04,936340,1995
149
+ DUK,Duke Energy,Utilities,Electric Utilities,"Charlotte, North Carolina",1976-06-30,1326160,1904
150
+ DVA,DaVita Inc.,Health Care,Health Care Services,"Denver, Colorado",2008-07-31,927066,1979
151
+ DVN,Devon Energy,Energy,Oil & Gas Exploration & Production,"Oklahoma City, Oklahoma",2000-08-30,1090012,1971
152
+ DXCM,Dexcom,Health Care,Health Care Equipment,"San Diego, California",2020-05-12,1093557,1999
153
+ EA,Electronic Arts,Communication Services,Interactive Home Entertainment,"Redwood City, California",2002-07-22,712515,1982
154
+ EBAY,eBay,Consumer Discretionary,Broadline Retail,"San Jose, California",2002-07-22,1065088,1995
155
+ ECL,Ecolab,Materials,Specialty Chemicals,"Saint Paul, Minnesota",1989-01-31,31462,1923
156
+ ED,Consolidated Edison,Utilities,Multi-Utilities,"New York City, New York",1957-03-04,1047862,1823
157
+ EFX,Equifax,Industrials,Research & Consulting Services,"Atlanta, Georgia",1997-06-19,33185,1899
158
+ EG,Everest Re,Financials,Reinsurance,"Hamilton, Bermuda",2017-06-19,1095073,1973
159
+ EIX,Edison International,Utilities,Electric Utilities,"Rosemead, California",1957-03-04,827052,1886
160
+ EL,Estée Lauder Companies (The),Consumer Staples,Personal Care Products,"New York City, New York",2006-01-05,1001250,1946
161
+ ELV,Elevance Health,Health Care,Managed Health Care,"Indianapolis, Indiana",2002-07-25,1156039,2014 (1946)
162
+ EMN,Eastman Chemical Company,Materials,Specialty Chemicals,"Kingsport, Tennessee",1994-01-01,915389,1920
163
+ EMR,Emerson Electric,Industrials,Electrical Components & Equipment,"Ferguson, Missouri",1965-03-31,32604,1890
164
+ ENPH,Enphase,Information Technology,Semiconductor Materials & Equipment,"Fremont, California",2021-01-07,1463101,2006
165
+ EOG,EOG Resources,Energy,Oil & Gas Exploration & Production,"Houston, Texas",2000-11-02,821189,1999
166
+ EPAM,EPAM Systems,Information Technology,IT Consulting & Other Services,"Newtown, Pennsylvania",2021-12-14,1352010,1993
167
+ EQIX,Equinix,Real Estate,Data Center REITs,"Redwood City, California",2015-03-20,1101239,1998
168
+ EQR,Equity Residential,Real Estate,Multi-Family Residential REITs,"Chicago, Illinois",2001-12-03,906107,1969
169
+ EQT,EQT,Energy,Oil & Gas Exploration & Production,"Pittsburgh, Pennsylvania",2022-10-03,33213,1888
170
+ ES,Eversource,Utilities,Electric Utilities,"Hartford, Connecticut",2009-07-24,72741,1966
171
+ ESS,Essex Property Trust,Real Estate,Multi-Family Residential REITs,"San Mateo, California",2014-04-02,920522,1971
172
+ ETN,Eaton Corporation,Industrials,Electrical Components & Equipment,"Dublin, Ireland",1957-03-04,1551182,1911
173
+ ETR,Entergy,Utilities,Electric Utilities,"New Orleans, Louisiana",1957-03-04,65984,1913
174
+ ETSY,Etsy,Consumer Discretionary,Broadline Retail,"New York City, New York",2020-09-21,1370637,2005
175
+ EVRG,Evergy,Utilities,Electric Utilities,"Kansas City, Missouri",2018-06-05,1711269,1909
176
+ EW,Edwards Lifesciences,Health Care,Health Care Equipment,"Irvine, California",2011-04-01,1099800,1958
177
+ EXC,Exelon,Utilities,Electric Utilities,"Chicago, Illinois",1957-03-04,1109357,2000
178
+ EXPD,Expeditors International,Industrials,Air Freight & Logistics,"Seattle, Washington",2007-10-10,746515,1979
179
+ EXPE,Expedia Group,Consumer Discretionary,"Hotels, Resorts & Cruise Lines","Seattle, Washington",2007-10-02,1324424,1996
180
+ EXR,Extra Space Storage,Real Estate,Self-Storage REITs,"Salt Lake City, Utah",2016-01-19,1289490,1977
181
+ F,Ford Motor Company,Consumer Discretionary,Automobile Manufacturers,"Dearborn, Michigan",1957-03-04,37996,1903
182
+ FANG,Diamondback Energy,Energy,Oil & Gas Exploration & Production,"Midland, Texas",2018-12-03,1539838,2007
183
+ FAST,Fastenal,Industrials,Trading Companies & Distributors,"Winona, Minnesota",2008-09-15,815556,1967
184
+ FCX,Freeport-McMoRan,Materials,Copper,"Phoenix, Arizona",2011-07-01,831259,1912
185
+ FDS,FactSet,Financials,Financial Exchanges & Data,"Norwalk, Connecticut",2021-12-20,1013237,1978
186
+ FDX,FedEx,Industrials,Air Freight & Logistics,"Memphis, Tennessee",1980-12-31,1048911,1971
187
+ FE,FirstEnergy,Utilities,Electric Utilities,"Akron, Ohio",1997-11-28,1031296,1997
188
+ FFIV,"F5, Inc.",Information Technology,Communications Equipment,"Seattle, Washington",2010-12-20,1048695,1996
189
+ FI,Fiserv,Financials,Transaction & Payment Processing Services,"Brookfield, Wisconsin",2001-04-02,798354,1984
190
+ FICO,Fair Isaac,Information Technology,Application Software,"Bozeman, Montana",2023-03-20,814547,1956
191
+ FIS,Fidelity National Information Services,Financials,Transaction & Payment Processing Services,"Jacksonville, Florida",2006-11-10,1136893,1968
192
+ FITB,Fifth Third Bank,Financials,Diversified Banks,"Cincinnati, Ohio",1996-03-29,35527,1858
193
+ FLT,Fleetcor,Financials,Transaction & Payment Processing Services,"Atlanta, Georgia",2018-06-20,1175454,2000
194
+ FMC,FMC Corporation,Materials,Fertilizers & Agricultural Chemicals,"Philadelphia, Pennsylvania",2009-08-19,37785,1883
195
+ FOX,Fox Corporation (Class B),Communication Services,Broadcasting,"New York City, New York",2019-03-04,1754301,2019
196
+ FOXA,Fox Corporation (Class A),Communication Services,Broadcasting,"New York City, New York",2019-03-04,1754301,2019
197
+ FRT,Federal Realty,Real Estate,Retail REITs,"Rockville, Maryland",2016-02-01,34903,1962
198
+ FSLR,First Solar,Information Technology,Semiconductors,"Tempe, Arizona",2022-12-19,1274494,1999
199
+ FTNT,Fortinet,Information Technology,Systems Software,"Sunnyvale, California",2018-10-11,1262039,2000
200
+ FTV,Fortive,Industrials,Industrial Machinery & Supplies & Components,"Everett, Washington",2016-07-01,1659166,2016
201
+ GD,General Dynamics,Industrials,Aerospace & Defense,"Falls Church, Virginia",1957-03-04,40533,1899
202
+ GE,General Electric,Industrials,Industrial Conglomerates,"Boston, Massachusetts",1957-03-04,40545,1892
203
+ GEHC,GE HealthCare,Health Care,Health Care Equipment,"Chicago, Illinois",2023-01-04,1932393,1994
204
+ GEN,Gen Digital,Information Technology,Systems Software,"Tempe, Arizona",2003-03-25,849399,1982
205
+ GILD,Gilead Sciences,Health Care,Biotechnology,"Foster City, California",2004-07-01,882095,1987
206
+ GIS,General Mills,Consumer Staples,Packaged Foods & Meats,"Golden Valley, Minnesota",1957-03-04,40704,1856
207
+ GL,Globe Life,Financials,Life & Health Insurance,"McKinney, Texas",1989-04-30,320335,1900
208
+ GLW,Corning Inc.,Information Technology,Electronic Components,"Corning, New York",1995-02-27,24741,1851
209
+ GM,General Motors,Consumer Discretionary,Automobile Manufacturers,"Detroit, Michigan",2013-06-06,1467858,1908
210
+ GNRC,Generac,Industrials,Electrical Components & Equipment,"Waukesha, Wisconsin",2021-03-22,1474735,1959
211
+ GOOG,Alphabet Inc. (Class C),Communication Services,Interactive Media & Services,"Mountain View, California",2006-04-03,1652044,1998
212
+ GOOGL,Alphabet Inc. (Class A),Communication Services,Interactive Media & Services,"Mountain View, California",2014-04-03,1652044,1998
213
+ GPC,Genuine Parts Company,Consumer Discretionary,Distributors,"Atlanta, Georgia",1973-12-31,40987,1925
214
+ GPN,Global Payments,Financials,Transaction & Payment Processing Services,"Atlanta, Georgia",2016-04-25,1123360,2000
215
+ GRMN,Garmin,Consumer Discretionary,Consumer Electronics,"Schaffhausen, Switzerland",2012-12-12,1121788,1989
216
+ GS,Goldman Sachs,Financials,Investment Banking & Brokerage,"New York City, New York",2002-07-22,886982,1869
217
+ GWW,W. W. Grainger,Industrials,Industrial Machinery & Supplies & Components,"Lake Forest, Illinois",1981-06-30,277135,1927
218
+ HAL,Halliburton,Energy,Oil & Gas Equipment & Services,"Houston, Texas",1957-03-04,45012,1919
219
+ HAS,Hasbro,Consumer Discretionary,Leisure Products,"Pawtucket, Rhode Island",1984-09-30,46080,1923
220
+ HBAN,Huntington Bancshares,Financials,Regional Banks,"Columbus, Ohio; Detroit, Michigan",1997-08-28,49196,1866
221
+ HCA,HCA Healthcare,Health Care,Health Care Facilities,"Nashville, Tennessee",2015-01-27,860730,1968
222
+ HD,Home Depot (The),Consumer Discretionary,Home Improvement Retail,"Atlanta, Georgia",1988-03-31,354950,1978
223
+ HES,Hess Corporation,Energy,Integrated Oil & Gas,"New York City, New York",1984-05-31,4447,1919
224
+ HIG,Hartford (The),Financials,Property & Casualty Insurance,"Hartford, Connecticut",1957-03-04,874766,1810
225
+ HII,Huntington Ingalls Industries,Industrials,Aerospace & Defense,"Newport News, Virginia",2018-01-03,1501585,2011
226
+ HLT,Hilton Worldwide,Consumer Discretionary,"Hotels, Resorts & Cruise Lines","Tysons Corner, Virginia",2017-06-19,1585689,1919
227
+ HOLX,Hologic,Health Care,Health Care Equipment,"Marlborough, Massachusetts",2016-03-30,859737,1985
228
+ HON,Honeywell,Industrials,Industrial Conglomerates,"Charlotte, North Carolina",1957-03-04,773840,1906
229
+ HPE,Hewlett Packard Enterprise,Information Technology,"Technology Hardware, Storage & Peripherals","Houston, Texas",2015-11-02,1645590,2015
230
+ HPQ,HP Inc.,Information Technology,"Technology Hardware, Storage & Peripherals","Palo Alto, California",1974-12-31,47217,1939 (2015)
231
+ HRL,Hormel Foods,Consumer Staples,Packaged Foods & Meats,"Austin, Minnesota",2009-03-04,48465,1891
232
+ HSIC,Henry Schein,Health Care,Health Care Distributors,"Melville, New York",2015-03-17,1000228,1932
233
+ HST,Host Hotels & Resorts,Real Estate,Hotel & Resort REITs,"Bethesda, Maryland",2007-03-20,1070750,1993
234
+ HSY,Hershey's,Consumer Staples,Packaged Foods & Meats,"Hershey, Pennsylvania",1957-03-04,47111,1894
235
+ HUBB,Hubbell Incorporated,Industrials,Industrial Machinery & Supplies & Components,"Shelton, Connecticut",2023-10-18,48898,1888
236
+ HUM,Humana,Health Care,Managed Health Care,"Louisville, Kentucky",2012-12-10,49071,1961
237
+ HWM,Howmet Aerospace,Industrials,Aerospace & Defense,"Pittsburgh, Pennsylvania",2016-10-21,4281,1888
238
+ IBM,IBM,Information Technology,IT Consulting & Other Services,"Armonk, New York",1957-03-04,51143,1911
239
+ ICE,Intercontinental Exchange,Financials,Financial Exchanges & Data,"Atlanta, Georgia",2007-09-26,1571949,2000
240
+ IDXX,Idexx Laboratories,Health Care,Health Care Equipment,"Westbrook, Maine",2017-01-05,874716,1983
241
+ IEX,IDEX Corporation,Industrials,Industrial Machinery & Supplies & Components,"Lake Forest, Illinois",2019-08-09,832101,1988
242
+ IFF,International Flavors & Fragrances,Materials,Specialty Chemicals,"New York City, New York",1976-03-31,51253,1958 (1889)
243
+ ILMN,Illumina,Health Care,Life Sciences Tools & Services,"San Diego, California",2015-11-19,1110803,1998
244
+ INCY,Incyte,Health Care,Biotechnology,"Wilmington, Delaware",2017-02-28,879169,1991
245
+ INTC,Intel,Information Technology,Semiconductors,"Santa Clara, California",1976-12-31,50863,1968
246
+ INTU,Intuit,Information Technology,Application Software,"Mountain View, California",2000-12-05,896878,1983
247
+ INVH,Invitation Homes,Real Estate,Single-Family Residential REITs,"Dallas, Texas",2022-09-19,1687229,2012
248
+ IP,International Paper,Materials,Paper & Plastic Packaging Products & Materials,"Memphis, Tennessee",1957-03-04,51434,1898
249
+ IPG,Interpublic Group of Companies (The),Communication Services,Advertising,"New York City, New York",1992-10-01,51644,1961 (1930)
250
+ IQV,IQVIA,Health Care,Life Sciences Tools & Services,"Durham, North Carolina",2017-08-29,1478242,1982
251
+ IR,Ingersoll Rand,Industrials,Industrial Machinery & Supplies & Components,"Davidson, North Carolina",2020-03-03,1699150,1859
252
+ IRM,Iron Mountain,Real Estate,Other Specialized REITs,"Boston, Massachusetts",2009-01-06,1020569,1951
253
+ ISRG,Intuitive Surgical,Health Care,Health Care Equipment,"Sunnyvale, California",2008-06-02,1035267,1995
254
+ IT,Gartner,Information Technology,IT Consulting & Other Services,"Stamford, Connecticut",2017-04-05,749251,1979
255
+ ITW,Illinois Tool Works,Industrials,Industrial Machinery & Supplies & Components,"Glenview, Illinois",1986-02-28,49826,1912
256
+ IVZ,Invesco,Financials,Asset Management & Custody Banks,"Atlanta, Georgia",2008-08-21,914208,1935
257
+ J,Jacobs Solutions,Industrials,Construction & Engineering,"Dallas, Texas",2007-10-26,52988,1947
258
+ JBHT,J.B. Hunt,Industrials,Cargo Ground Transportation,"Lowell, Arkansas",2015-07-01,728535,1961
259
+ JBL,Jabil,Information Technology,Electronic Manufacturing Services,"St. Petersburg, Florida",2023-12-18,898293,1966
260
+ JCI,Johnson Controls,Industrials,Building Products,"Cork, Ireland",2010-08-27,833444,1885
261
+ JKHY,Jack Henry & Associates,Financials,Transaction & Payment Processing Services,"Monett, Missouri",2018-11-13,779152,1976
262
+ JNJ,Johnson & Johnson,Health Care,Pharmaceuticals,"New Brunswick, New Jersey",1973-06-30,200406,1886
263
+ JNPR,Juniper Networks,Information Technology,Communications Equipment,"Sunnyvale, California",2006-06-02,1043604,1996
264
+ JPM,JPMorgan Chase,Financials,Diversified Banks,"New York City, New York",1975-06-30,19617,2000 (1799 / 1871)
265
+ K,Kellanova,Consumer Staples,Packaged Foods & Meats,"Chicago, Illinois",1989-09-11,55067,1906
266
+ KDP,Keurig Dr Pepper,Consumer Staples,Soft Drinks & Non-alcoholic Beverages,"Burlington, Massachusetts",2022-06-21,1418135,1981
267
+ KEY,KeyCorp,Financials,Regional Banks,"Cleveland, Ohio",1994-03-01,91576,1825
268
+ KEYS,Keysight,Information Technology,Electronic Equipment & Instruments,"Santa Rosa, California",2018-11-06,1601046,2014 (1939)
269
+ KHC,Kraft Heinz,Consumer Staples,Packaged Foods & Meats,"Chicago, Illinois; Pittsburgh, Pennsylvania",2015-07-06,1637459,2015 (1869)
270
+ KIM,Kimco Realty,Real Estate,Retail REITs,"New Hyde Park, New York",2006-04-04,879101,1958
271
+ KLAC,KLA Corporation,Information Technology,Semiconductor Materials & Equipment,"Milpitas, California",1997-09-30,319201,1975/1977 (1997)
272
+ KMB,Kimberly-Clark,Consumer Staples,Household Products,"Irving, Texas",1957-03-04,55785,1872
273
+ KMI,Kinder Morgan,Energy,Oil & Gas Storage & Transportation,"Houston, Texas",2012-05-25,1506307,1997
274
+ KMX,CarMax,Consumer Discretionary,Automotive Retail,"Richmond, Virginia",2010-06-28,1170010,1993
275
+ KO,Coca-Cola Company (The),Consumer Staples,Soft Drinks & Non-alcoholic Beverages,"Atlanta, Georgia",1957-03-04,21344,1886
276
+ KR,Kroger,Consumer Staples,Food Retail,"Cincinnati, Ohio",1957-03-04,56873,1883
277
+ KVUE,Kenvue,Consumer Staples,Personal Care Products,"Skillman, New Jersey",2023-08-25,1944048,2022 (Johnson & Johnson spinoff)
278
+ L,Loews Corporation,Financials,Multi-line Insurance,"New York City, New York",1995-05-31,60086,1959
279
+ LDOS,Leidos,Industrials,Diversified Support Services,"Reston, Virginia",2019-08-09,1336920,1969
280
+ LEN,Lennar,Consumer Discretionary,Homebuilding,"Miami, Florida",2005-10-04,920760,1954
281
+ LH,LabCorp,Health Care,Health Care Services,"Burlington, North Carolina",2004-11-01,920148,1978
282
+ LHX,L3Harris,Industrials,Aerospace & Defense,"Melbourne, Florida",2008-09-22,202058,"2019 (L3 1997, Harris 1895)"
283
+ LIN,Linde plc,Materials,Industrial Gases,"Guildford, United Kingdom",1992-07-01,1707925,1879
284
+ LKQ,LKQ Corporation,Consumer Discretionary,Distributors,"Chicago, Illinois",2016-05-23,1065696,1998
285
+ LLY,Eli Lilly and Company,Health Care,Pharmaceuticals,"Indianapolis, Indiana",1970-12-31,59478,1876
286
+ LMT,Lockheed Martin,Industrials,Aerospace & Defense,"Bethesda, Maryland",1957-03-04,936468,1995
287
+ LNT,Alliant Energy,Utilities,Electric Utilities,"Madison, Wisconsin",2016-07-01,352541,1917
288
+ LOW,Lowe's,Consumer Discretionary,Home Improvement Retail,"Mooresville, North Carolina",1984-02-29,60667,1904/1946/1959
289
+ LRCX,Lam Research,Information Technology,Semiconductor Materials & Equipment,"Fremont, California",2012-06-29,707549,1980
290
+ LULU,Lululemon Athletica,Consumer Discretionary,"Apparel, Accessories & Luxury Goods","Vancouver, Canada",2023-10-18,1397187,1998
291
+ LUV,Southwest Airlines,Industrials,Passenger Airlines,"Dallas, Texas",1994-07-01,92380,1967
292
+ LVS,Las Vegas Sands,Consumer Discretionary,Casinos & Gaming,"Las Vegas, Nevada",2019-10-03,1300514,1988
293
+ LW,Lamb Weston,Consumer Staples,Packaged Foods & Meats,"Eagle, Idaho",2018-12-03,1679273,2016 (1950)
294
+ LYB,LyondellBasell,Materials,Specialty Chemicals,"Rotterdam, Netherlands",2012-09-05,1489393,2007
295
+ LYV,Live Nation Entertainment,Communication Services,Movies & Entertainment,"Beverly Hills, California",2019-12-23,1335258,2010
296
+ MA,Mastercard,Financials,Transaction & Payment Processing Services,"Harrison, New York",2008-07-18,1141391,1966
297
+ MAA,Mid-America Apartment Communities,Real Estate,Multi-Family Residential REITs,"Memphis, Tennessee",2016-12-02,912595,1977
298
+ MAR,Marriott International,Consumer Discretionary,"Hotels, Resorts & Cruise Lines","Bethesda, Maryland",1998-05-29,1048286,1927
299
+ MAS,Masco,Industrials,Building Products,"Livonia, Michigan",1981-06-30,62996,1929
300
+ MCD,McDonald's,Consumer Discretionary,Restaurants,"Chicago, Illinois",1970-06-30,63908,1940
301
+ MCHP,Microchip Technology,Information Technology,Semiconductors,"Chandler, Arizona",2007-09-07,827054,1989
302
+ MCK,McKesson,Health Care,Health Care Distributors,"Irving, Texas",1999-01-13,927653,1833
303
+ MCO,Moody's Corporation,Financials,Financial Exchanges & Data,"New York City, New York",1998-07-01,1059556,1909
304
+ MDLZ,Mondelez International,Consumer Staples,Packaged Foods & Meats,"Chicago, Illinois",2012-10-02,1103982,2012
305
+ MDT,Medtronic,Health Care,Health Care Equipment,"Dublin, Ireland",1986-10-31,1613103,1949
306
+ MET,MetLife,Financials,Life & Health Insurance,"New York City, New York",2000-12-11,1099219,1868
307
+ META,Meta Platforms,Communication Services,Interactive Media & Services,"Menlo Park, California",2013-12-23,1326801,2004
308
+ MGM,MGM Resorts,Consumer Discretionary,Casinos & Gaming,"Paradise, Nevada",2017-07-26,789570,1986
309
+ MHK,Mohawk Industries,Consumer Discretionary,Home Furnishings,"Calhoun, Georgia",2013-12-23,851968,1878
310
+ MKC,McCormick & Company,Consumer Staples,Packaged Foods & Meats,"Hunt Valley, Maryland",2003-03-20,63754,1889
311
+ MKTX,MarketAxess,Financials,Financial Exchanges & Data,"New York City, New York",2019-07-01,1278021,2000
312
+ MLM,Martin Marietta Materials,Materials,Construction Materials,"Raleigh, North Carolina",2014-07-02,916076,1993
313
+ MMC,Marsh McLennan,Financials,Insurance Brokers,"New York City, New York",1987-08-31,62709,1905
314
+ MMM,3M,Industrials,Industrial Conglomerates,"Saint Paul, Minnesota",1957-03-04,66740,1902
315
+ MNST,Monster Beverage,Consumer Staples,Soft Drinks & Non-alcoholic Beverages,"Corona, California",2012-06-28,865752,2012 (1935)
316
+ MO,Altria,Consumer Staples,Tobacco,"Richmond, Virginia",1957-03-04,764180,1985
317
+ MOH,Molina Healthcare,Health Care,Managed Health Care,"Long Beach, California",2022-03-02,1179929,1980
318
+ MOS,Mosaic Company (The),Materials,Fertilizers & Agricultural Chemicals,"Tampa, Florida",2011-09-26,1285785,2004 (1865 / 1909)
319
+ MPC,Marathon Petroleum,Energy,Oil & Gas Refining & Marketing,"Findlay, Ohio",2011-07-01,1510295,2009 (1887)
320
+ MPWR,Monolithic Power Systems,Information Technology,Semiconductors,"Kirkland, Washington",2021-02-12,1280452,1997
321
+ MRK,Merck & Co.,Health Care,Pharmaceuticals,"Kenilworth, New Jersey",1957-03-04,310158,1891
322
+ MRNA,Moderna,Health Care,Biotechnology,"Cambridge, Massachusetts",2021-07-21,1682852,2010
323
+ MRO,Marathon Oil,Energy,Oil & Gas Exploration & Production,"Houston, Texas",1957-03-04,101778,1887
324
+ MS,Morgan Stanley,Financials,Investment Banking & Brokerage,"New York City, New York",1993-07-29,895421,1935
325
+ MSCI,MSCI,Financials,Financial Exchanges & Data,"New York City, New York",2018-04-04,1408198,1969
326
+ MSFT,Microsoft,Information Technology,Systems Software,"Redmond, Washington",1994-06-01,789019,1975
327
+ MSI,Motorola Solutions,Information Technology,Communications Equipment,"Chicago, Illinois",1957-03-04,68505,1928 (2011)
328
+ MTB,M&T Bank,Financials,Regional Banks,"Buffalo, New York",2004-02-23,36270,1856
329
+ MTCH,Match Group,Communication Services,Interactive Media & Services,"Dallas, Texas",2021-09-20,891103,1986
330
+ MTD,Mettler Toledo,Health Care,Life Sciences Tools & Services,"Columbus, Ohio",2016-09-06,1037646,1945
331
+ MU,Micron Technology,Information Technology,Semiconductors,"Boise, Idaho",1994-09-27,723125,1978
332
+ NCLH,Norwegian Cruise Line Holdings,Consumer Discretionary,"Hotels, Resorts & Cruise Lines","Miami, Florida",2017-10-13,1513761,2011 (1966)
333
+ NDAQ,"Nasdaq, Inc.",Financials,Financial Exchanges & Data,"New York City, New York",2008-10-22,1120193,1971
334
+ NDSN,Nordson Corporation,Industrials,Industrial Machinery & Supplies & Components,"Westlake, Ohio",2022-02-15,72331,1935
335
+ NEE,NextEra Energy,Utilities,Multi-Utilities,"Juno Beach, Florida",1976-06-30,753308,1984 (1925)
336
+ NEM,Newmont,Materials,Gold,"Denver, Colorado",1969-06-30,1164727,1921
337
+ NFLX,Netflix,Communication Services,Movies & Entertainment,"Los Gatos, California",2010-12-20,1065280,1997
338
+ NI,NiSource,Utilities,Multi-Utilities,"Merrillville, Indiana",2000-11-02,1111711,1912
339
+ NKE,"Nike, Inc.",Consumer Discretionary,"Apparel, Accessories & Luxury Goods","Washington County, Oregon",1988-11-30,320187,1964
340
+ NOC,Northrop Grumman,Industrials,Aerospace & Defense,"West Falls Church, Virginia",1957-03-04,1133421,"1994 (Northrop 1939, Grumman 1930)"
341
+ NOW,ServiceNow,Information Technology,Systems Software,"Santa Clara, California",2019-11-21,1373715,2003
342
+ NRG,NRG Energy,Utilities,Independent Power Producers & Energy Traders,"Houston, Texas",2010-01-29,1013871,1992
343
+ NSC,Norfolk Southern Railway,Industrials,Rail Transportation,"Atlanta, Georgia",1957-03-04,702165,1881/1894 (1980)
344
+ NTAP,NetApp,Information Technology,"Technology Hardware, Storage & Peripherals","San Jose, California",1999-06-25,1002047,1992
345
+ NTRS,Northern Trust,Financials,Asset Management & Custody Banks,"Chicago, Illinois",1998-01-30,73124,1889
346
+ NUE,Nucor,Materials,Steel,"Charlotte, North Carolina",1985-04-30,73309,1940
347
+ NVDA,Nvidia,Information Technology,Semiconductors,"Santa Clara, California",2001-11-30,1045810,1993
348
+ NVR,"NVR, Inc.",Consumer Discretionary,Homebuilding,"Reston, Virginia",2019-09-26,906163,1980
349
+ NWS,News Corp (Class B),Communication Services,Publishing,"New York City, New York",2015-09-18,1564708,2013 (News Corporation 1980)
350
+ NWSA,News Corp (Class A),Communication Services,Publishing,"New York City, New York",2013-08-01,1564708,2013 (News Corporation 1980)
351
+ NXPI,NXP Semiconductors,Information Technology,Semiconductors,"Eindhoven, Netherlands",2021-03-22,1413447,1953
352
+ O,Realty Income,Real Estate,Retail REITs,"San Diego, California",2015-04-07,726728,1969
353
+ ODFL,Old Dominion,Industrials,Cargo Ground Transportation,"Thomasville, North Carolina",2019-12-09,878927,1934
354
+ OKE,ONEOK,Energy,Oil & Gas Storage & Transportation,"Tulsa, Oklahoma",2010-03-15,1039684,1906
355
+ OMC,Omnicom Group,Communication Services,Advertising,"New York City, New York",1997-12-31,29989,1986
356
+ ON,ON Semiconductor,Information Technology,Semiconductors,"Phoenix, Arizona",2022-06-21,1097864,1999
357
+ ORCL,Oracle Corporation,Information Technology,Application Software,"Austin, Texas",1989-08-31,1341439,1977
358
+ ORLY,O'Reilly Auto Parts,Consumer Discretionary,Automotive Retail,"Springfield, Missouri",2009-03-27,898173,1957
359
+ OTIS,Otis Worldwide,Industrials,Industrial Machinery & Supplies & Components,"Farmington, Connecticut",2020-04-03,1781335,"2020 (1853, United Technologies spinoff)"
360
+ OXY,Occidental Petroleum,Energy,Oil & Gas Exploration & Production,"Houston, Texas",1957-03-04,797468,1920
361
+ PANW,Palo Alto Networks,Information Technology,Systems Software,"Santa Clara, California",2023-06-20,1327567,2005
362
+ PARA,Paramount Global,Communication Services,Movies & Entertainment,"New York City, New York",1994-09-30,813828,2019 (Paramount Pictures 1912)
363
+ PAYC,Paycom,Industrials,Human Resource & Employment Services,"Oklahoma City, Oklahoma",2020-01-28,1590955,1998
364
+ PAYX,Paychex,Industrials,Human Resource & Employment Services,"Penfield, New York",1998-10-01,723531,1971
365
+ PCAR,Paccar,Industrials,Construction Machinery & Heavy Transportation Equipment,"Bellevue, Washington",1980-12-31,75362,1905
366
+ PCG,PG&E Corporation,Utilities,Multi-Utilities,"San Francisco, California",2022-10-03,1004980,1905
367
+ PEG,Public Service Enterprise Group,Utilities,Electric Utilities,"Newark, New Jersey",1957-03-04,788784,1903
368
+ PEP,PepsiCo,Consumer Staples,Soft Drinks & Non-alcoholic Beverages,"Purchase, New York",1957-03-04,77476,1898
369
+ PFE,Pfizer,Health Care,Pharmaceuticals,"New York City, New York",1957-03-04,78003,1849
370
+ PFG,Principal Financial Group,Financials,Life & Health Insurance,"Des Moines, Iowa",2002-07-22,1126328,1879
371
+ PG,Procter & Gamble,Consumer Staples,Personal Care Products,"Cincinnati, Ohio",1957-03-04,80424,1837
372
+ PGR,Progressive Corporation,Financials,Property & Casualty Insurance,"Mayfield Village, Ohio",1997-08-04,80661,1937
373
+ PH,Parker Hannifin,Industrials,Industrial Machinery & Supplies & Components,"Cleveland, Ohio",1985-11-30,76334,1917
374
+ PHM,PulteGroup,Consumer Discretionary,Homebuilding,"Atlanta, Georgia",1984-04-30,822416,1956
375
+ PKG,Packaging Corporation of America,Materials,Paper & Plastic Packaging Products & Materials,"Lake Forest, Illinois",2017-07-26,75677,1959
376
+ PLD,Prologis,Real Estate,Industrial REITs,"San Francisco, California",2003-07-17,1045609,1983
377
+ PM,Philip Morris International,Consumer Staples,Tobacco,"New York City, New York",2008-03-31,1413329,2008 (1847)
378
+ PNC,PNC Financial Services,Financials,Regional Banks,"Pittsburgh, Pennsylvania",1988-04-30,713676,1845
379
+ PNR,Pentair,Industrials,Industrial Machinery & Supplies & Components,"Worsley, United Kingdom",2012-10-01,77360,1966
380
+ PNW,Pinnacle West,Utilities,Multi-Utilities,"Phoenix, Arizona",1999-10-04,764622,1985
381
+ PODD,Insulet,Health Care,Health Care Equipment,"Acton, Massachusetts",2023-03-15,1145197,2000
382
+ POOL,Pool Corporation,Consumer Discretionary,Distributors,"Covington, Louisiana",2020-10-07,945841,1993
383
+ PPG,PPG Industries,Materials,Specialty Chemicals,"Pittsburgh, Pennsylvania",1957-03-04,79879,1883
384
+ PPL,PPL Corporation,Utilities,Electric Utilities,"Allentown, Pennsylvania",2001-10-01,922224,1920
385
+ PRU,Prudential Financial,Financials,Life & Health Insurance,"Newark, New Jersey",2002-07-22,1137774,1875
386
+ PSA,Public Storage,Real Estate,Self-Storage REITs,"Glendale, California",2005-08-19,1393311,1972
387
+ PSX,Phillips 66,Energy,Oil & Gas Refining & Marketing,"Houston, Texas",2012-05-01,1534701,2012 (1917)
388
+ PTC,PTC,Information Technology,Application Software,"Boston, Massachusetts",2021-04-20,857005,1985
389
+ PWR,Quanta Services,Industrials,Construction & Engineering,"Houston, Texas",2009-07-01,1050915,1997
390
+ PXD,Pioneer Natural Resources,Energy,Oil & Gas Exploration & Production,"Irving, Texas",2008-09-24,1038357,1997
391
+ PYPL,PayPal,Financials,Transaction & Payment Processing Services,"San Jose, California",2015-07-20,1633917,1998
392
+ QCOM,Qualcomm,Information Technology,Semiconductors,"San Diego, California",1999-07-22,804328,1985
393
+ QRVO,Qorvo,Information Technology,Semiconductors,"Greensboro, North Carolina",2015-06-11,1604778,2015
394
+ RCL,Royal Caribbean Group,Consumer Discretionary,"Hotels, Resorts & Cruise Lines","Miami, Florida",2014-12-05,884887,1997
395
+ REG,Regency Centers,Real Estate,Retail REITs,"Jacksonville, Florida",2017-03-02,910606,1963
396
+ REGN,Regeneron,Health Care,Biotechnology,"Tarrytown, New York",2013-05-01,872589,1988
397
+ RF,Regions Financial Corporation,Financials,Regional Banks,"Birmingham, Alabama",1998-08-28,1281761,1971
398
+ RHI,Robert Half,Industrials,Human Resource & Employment Services,"Menlo Park, California",2000-12-05,315213,1948
399
+ RJF,Raymond James,Financials,Investment Banking & Brokerage,"St. Petersburg, Florida",2017-03-20,720005,1962
400
+ RL,Ralph Lauren Corporation,Consumer Discretionary,"Apparel, Accessories & Luxury Goods","New York City, New York",2007-02-02,1037038,1967
401
+ RMD,ResMed,Health Care,Health Care Equipment,"San Diego, California",2017-07-26,943819,1989
402
+ ROK,Rockwell Automation,Industrials,Electrical Components & Equipment,"Milwaukee, Wisconsin",2000-03-12,1024478,1903
403
+ ROL,"Rollins, Inc.",Industrials,Environmental & Facilities Services,"Atlanta, Georgia",2018-10-01,84839,1948
404
+ ROP,Roper Technologies,Information Technology,Electronic Equipment & Instruments,"Sarasota, Florida",2009-12-23,882835,1981
405
+ ROST,Ross Stores,Consumer Discretionary,Apparel Retail,"Dublin, California",2009-12-21,745732,1982
406
+ RSG,Republic Services,Industrials,Environmental & Facilities Services,"Phoenix, Arizona",2008-12-05,1060391,1998 (1981)
407
+ RTX,RTX Corporation,Industrials,Aerospace & Defense,"Waltham, Massachusetts",1957-03-04,101829,1922
408
+ RVTY,Revvity,Health Care,Health Care Equipment,"Waltham, Massachusetts",1985-05-31,31791,1937
409
+ SBAC,SBA Communications,Real Estate,Telecom Tower REITs,"Boca Raton, Florida",2017-09-01,1034054,1989
410
+ SBUX,Starbucks,Consumer Discretionary,Restaurants,"Seattle, Washington",2000-06-07,829224,1971
411
+ SCHW,Charles Schwab Corporation,Financials,Investment Banking & Brokerage,"Westlake, Texas",1997-06-02,316709,1971
412
+ SHW,Sherwin-Williams,Materials,Specialty Chemicals,"Cleveland, Ohio",1964-06-30,89800,1866
413
+ SJM,J.M. Smucker Company (The),Consumer Staples,Packaged Foods & Meats,"Orrville, Ohio",2008-11-06,91419,1897
414
+ SLB,Schlumberger,Energy,Oil & Gas Equipment & Services,"Houston, Texas",1957-03-04,87347,1926
415
+ SMCI,Supermicro,Information Technology,"Technology Hardware, Storage & Peripherals","San Jose, California",2024-03-18,1375365,1993
416
+ SNA,Snap-on,Industrials,Industrial Machinery & Supplies & Components,"Kenosha, Wisconsin",1982-09-30,91440,1920
417
+ SNPS,Synopsys,Information Technology,Application Software,"Sunnyvale, California",2017-03-16,883241,1986
418
+ SO,Southern Company,Utilities,Electric Utilities,"Atlanta, Georgia",1957-03-04,92122,1945
419
+ SPG,Simon Property Group,Real Estate,Retail REITs,"Indianapolis, Indiana",2002-06-26,1063761,2003
420
+ SPGI,S&P Global,Financials,Financial Exchanges & Data,"New York City, New York",1957-03-04,64040,1917
421
+ SRE,Sempra Energy,Utilities,Multi-Utilities,"San Diego, California",2017-03-17,1032208,1998
422
+ STE,Steris,Health Care,Health Care Equipment,"Dublin, Ireland",2019-12-23,1757898,1985
423
+ STLD,Steel Dynamics,Materials,Steel,"Fort Wayne, Indiana",2022-12-22,1022671,1993
424
+ STT,State Street Corporation,Financials,Asset Management & Custody Banks,"Boston, Massachusetts",2003-03-14,93751,1792
425
+ STX,Seagate Technology,Information Technology,"Technology Hardware, Storage & Peripherals","Dublin, Ireland",2012-07-02,1137789,1979
426
+ STZ,Constellation Brands,Consumer Staples,Distillers & Vintners,"Victor, New York",2005-07-01,16918,1945
427
+ SWK,Stanley Black & Decker,Industrials,Industrial Machinery & Supplies & Components,"New Britain, Connecticut",1982-09-30,93556,1843
428
+ SWKS,Skyworks Solutions,Information Technology,Semiconductors,"Irvine, California",2015-03-12,4127,2002
429
+ SYF,Synchrony Financial,Financials,Consumer Finance,"Stamford, Connecticut",2015-11-18,1601712,2003
430
+ SYK,Stryker Corporation,Health Care,Health Care Equipment,"Kalamazoo, Michigan",2000-12-12,310764,1941
431
+ SYY,Sysco,Consumer Staples,Food Distributors,"Houston, Texas",1986-12-31,96021,1969
432
+ T,AT&T,Communication Services,Integrated Telecommunication Services,"Dallas, Texas",1983-11-30,732717,1983 (1885)
433
+ TAP,Molson Coors Beverage Company,Consumer Staples,Brewers,"Chicago, Illinois",1976-06-30,24545,"2005 (Molson 1786, Coors 1873)"
434
+ TDG,TransDigm Group,Industrials,Aerospace & Defense,"Cleveland, Ohio",2016-06-03,1260221,1993
435
+ TDY,Teledyne Technologies,Information Technology,Electronic Equipment & Instruments,"Thousand Oaks, California",2020-06-22,1094285,1960
436
+ TECH,Bio-Techne,Health Care,Life Sciences Tools & Services,"Minneapolis, Minnesota",2021-08-30,842023,1976
437
+ TEL,TE Connectivity,Information Technology,Electronic Manufacturing Services,"Schaffhausen, Switzerland",2011-10-17,1385157,2007
438
+ TER,Teradyne,Information Technology,Semiconductor Materials & Equipment,"North Reading, Massachusetts",2020-09-21,97210,1960
439
+ TFC,Truist,Financials,Regional Banks,"Charlotte, North Carolina",1997-12-04,92230,1872
440
+ TFX,Teleflex,Health Care,Health Care Equipment,"Wayne, Pennsylvania",2019-01-18,96943,1943
441
+ TGT,Target Corporation,Consumer Staples,Consumer Staples Merchandise Retail,"Minneapolis, Minnesota",1976-12-31,27419,1902
442
+ TJX,TJX Companies,Consumer Discretionary,Apparel Retail,"Framingham, Massachusetts",1985-09-30,109198,1987
443
+ TMO,Thermo Fisher Scientific,Health Care,Life Sciences Tools & Services,"Waltham, Massachusetts",2004-08-03,97745,2006 (1902)
444
+ TMUS,T-Mobile US,Communication Services,Wireless Telecommunication Services,"Bellevue, Washington",2019-07-15,1283699,1994
445
+ TPR,"Tapestry, Inc.",Consumer Discretionary,"Apparel, Accessories & Luxury Goods","New York City, New York",2004-09-01,1116132,2017
446
+ TRGP,Targa Resources,Energy,Oil & Gas Storage & Transportation,"Houston, Texas",2022-10-12,1389170,2005
447
+ TRMB,Trimble Inc.,Information Technology,Electronic Equipment & Instruments,"Westminster, Colorado",2021-01-21,864749,1978
448
+ TROW,T. Rowe Price,Financials,Asset Management & Custody Banks,"Baltimore, Maryland",2019-07-29,1113169,1937
449
+ TRV,Travelers Companies (The),Financials,Property & Casualty Insurance,"New York City, New York",2002-08-21,86312,1853
450
+ TSCO,Tractor Supply,Consumer Discretionary,Other Specialty Retail,"Brentwood, Tennessee",2014-01-24,916365,1938
451
+ TSLA,"Tesla, Inc.",Consumer Discretionary,Automobile Manufacturers,"Austin, Texas",2020-12-21,1318605,2003
452
+ TSN,Tyson Foods,Consumer Staples,Packaged Foods & Meats,"Springdale, Arkansas",2005-08-10,100493,1935
453
+ TT,Trane Technologies,Industrials,Building Products,"Dublin, Ireland",2010-11-17,1466258,1871
454
+ TTWO,Take-Two Interactive,Communication Services,Interactive Home Entertainment,"New York City, New York",2018-03-19,946581,1993
455
+ TXN,Texas Instruments,Information Technology,Semiconductors,"Dallas, Texas",2001-03-12,97476,1930
456
+ TXT,Textron,Industrials,Aerospace & Defense,"Providence, Rhode Island",1978-12-31,217346,1923
457
+ TYL,Tyler Technologies,Information Technology,Application Software,"Plano, Texas",2020-06-22,860731,1966
458
+ UAL,United Airlines Holdings,Industrials,Passenger Airlines,"Chicago, Illinois",2015-09-03,100517,1967
459
+ UBER,Uber,Industrials,Passenger Ground Transportation,"San Francisco, California",2023-12-18,1543151,2009
460
+ UDR,"UDR, Inc.",Real Estate,Multi-Family Residential REITs,"Highlands Ranch, Colorado",2016-03-07,74208,1972
461
+ UHS,Universal Health Services,Health Care,Health Care Facilities,"King of Prussia, Pennsylvania",2014-09-20,352915,1979
462
+ ULTA,Ulta Beauty,Consumer Discretionary,Other Specialty Retail,"Bolingbrook, Illinois",2016-04-18,1403568,1990
463
+ UNH,UnitedHealth Group,Health Care,Managed Health Care,"Minnetonka, Minnesota",1994-07-01,731766,1977
464
+ UNP,Union Pacific Corporation,Industrials,Rail Transportation,"Omaha, Nebraska",1957-03-04,100885,1862
465
+ UPS,United Parcel Service,Industrials,Air Freight & Logistics,"Sandy Springs, Georgia",2002-07-22,1090727,1907
466
+ URI,United Rentals,Industrials,Trading Companies & Distributors,"Stamford, Connecticut",2014-09-20,1067701,1997
467
+ USB,U.S. Bank,Financials,Diversified Banks,"Minneapolis, Minnesota",1999-11-01,36104,1968
468
+ V,Visa Inc.,Financials,Transaction & Payment Processing Services,"San Francisco, California",2009-12-21,1403161,1958
469
+ VFC,VF Corporation,Consumer Discretionary,"Apparel, Accessories & Luxury Goods","Denver, Colorado",1979-06-30,103379,1899
470
+ VICI,Vici Properties,Real Estate,Hotel & Resort REITs,"New York City, New York",2022-06-08,1705696,2017
471
+ VLO,Valero Energy,Energy,Oil & Gas Refining & Marketing,"San Antonio, Texas",2002-12-20,1035002,1980
472
+ VLTO,Veralto,Industrials,Environmental & Facilities Services,"Waltham, Massachusetts",2023-10-02,1967680,2023
473
+ VMC,Vulcan Materials Company,Materials,Construction Materials,"Birmingham, Alabama",1999-06-30,1396009,1909
474
+ VRSK,Verisk,Industrials,Research & Consulting Services,"Jersey City, New Jersey",2015-10-08,1442145,1971
475
+ VRSN,Verisign,Information Technology,Internet Services & Infrastructure,"Dulles, Virginia",2006-02-01,1014473,1995
476
+ VRTX,Vertex Pharmaceuticals,Health Care,Biotechnology,"Cambridge, Massachusetts",2013-09-23,875320,1989
477
+ VTR,Ventas,Real Estate,Health Care REITs,"Chicago, Illinois",2009-03-04,740260,1998
478
+ VTRS,Viatris,Health Care,Pharmaceuticals,"Pittsburgh, Pennsylvania",2004-04-23,1792044,1961
479
+ VZ,Verizon,Communication Services,Integrated Telecommunication Services,"New York City, New York",1983-11-30,732712,1983 (1877)
480
+ WAB,Wabtec,Industrials,Construction Machinery & Heavy Transportation Equipment,"Pittsburgh, Pennsylvania",2019-02-27,943452,1999 (1869)
481
+ WAT,Waters Corporation,Health Care,Life Sciences Tools & Services,"Milford, Massachusetts",2002-01-02,1000697,1958
482
+ WBA,Walgreens Boots Alliance,Consumer Staples,Drug Retail,"Deerfield, Illinois",1979-12-31,1618921,2014
483
+ WBD,Warner Bros. Discovery,Communication Services,Broadcasting,"New York City, New York",2022-04-11,1437107,2022 (Warner Bros. 1923)
484
+ WDC,Western Digital,Information Technology,"Technology Hardware, Storage & Peripherals","San Jose, California",2009-07-01,106040,1970
485
+ WEC,WEC Energy Group,Utilities,Electric Utilities,"Milwaukee, Wisconsin",2008-10-31,783325,1896
486
+ WELL,Welltower,Real Estate,Health Care REITs,"Toledo, Ohio",2009-01-30,766704,1970
487
+ WFC,Wells Fargo,Financials,Diversified Banks,"San Francisco, California",1976-06-30,72971,1852
488
+ WM,Waste Management,Industrials,Environmental & Facilities Services,"Houston, Texas",1998-08-31,823768,1968
489
+ WMB,Williams Companies,Energy,Oil & Gas Storage & Transportation,"Tulsa, Oklahoma",1975-03-31,107263,1908
490
+ WMT,Walmart,Consumer Staples,Consumer Staples Merchandise Retail,"Bentonville, Arkansas",1982-08-31,104169,1962
491
+ WRB,Berkley,Financials,Property & Casualty Insurance,"Greenwich, Connecticut",2019-12-05,11544,1967
492
+ WRK,WestRock,Materials,Paper & Plastic Packaging Products & Materials,"Atlanta, Georgia",2015-06-25,1732845,2015
493
+ WST,West Pharmaceutical Services,Health Care,Health Care Supplies,"Exton, Pennsylvania",2020-05-22,105770,1923
494
+ WTW,Willis Towers Watson,Financials,Insurance Brokers,"London, United Kingdom",2016-01-05,1140536,2016
495
+ WY,Weyerhaeuser,Real Estate,Timber REITs,"Seattle, Washington",1979-10-01,106535,1900
496
+ WYNN,Wynn Resorts,Consumer Discretionary,Casinos & Gaming,"Paradise, Nevada",2008-11-14,1174922,2002
497
+ XEL,Xcel Energy,Utilities,Multi-Utilities,"Minneapolis, Minnesota",1957-03-04,72903,1909
498
+ XOM,ExxonMobil,Energy,Integrated Oil & Gas,"Irving, Texas",1957-03-04,34088,1999
499
+ XRAY,Dentsply Sirona,Health Care,Health Care Supplies,"Charlotte, North Carolina",2008-11-14,818479,2016 (1969)
500
+ XYL,Xylem Inc.,Industrials,Industrial Machinery & Supplies & Components,"White Plains, New York",2011-11-01,1524472,2011
501
+ YUM,Yum! Brands,Consumer Discretionary,Restaurants,"Louisville, Kentucky",1997-10-06,1041061,1997
502
+ ZBH,Zimmer Biomet,Health Care,Health Care Equipment,"Warsaw, Indiana",2001-08-07,1136869,1927
503
+ ZBRA,Zebra Technologies,Information Technology,Electronic Equipment & Instruments,"Lincolnshire, Illinois",2019-12-23,877212,1969
504
+ ZTS,Zoetis,Health Care,Pharmaceuticals,"Parsippany, New Jersey",2013-06-21,1555280,1952
preprocess.py ADDED
@@ -0,0 +1,544 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import re
2
+ import sys
3
+ import os
4
+ import numpy as np
5
+ from collections import defaultdict
6
+ import pandas as pd
7
+ import time
8
+
9
+ # 如果使用 spaCy 进行 NLP 处理
10
+ import spacy
11
+
12
+ # 如果使用某种情感分析工具,比如 Hugging Face 的模型
13
+ from transformers import pipeline
14
+
15
+ # 还需要导入 pickle 模块(如果你在代码的其他部分使用了它来处理序列化/反序列化)
16
+ import pickle
17
+ from gensim.models import KeyedVectors
18
+ import akshare as ak
19
+
20
+ from gensim.models import Word2Vec
21
+ from transformers import pipeline, AutoTokenizer, AutoModelForSequenceClassification
22
+
23
+
24
+
25
+
26
+
27
+ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
28
+ from us_stock import *
29
+
30
+
31
+
32
+
33
+ # 强制使用 GPU
34
+ #spacy.require_gpu()
35
+
36
+ # 加载模型
37
+ nlp = spacy.load("en_core_web_md")
38
+
39
+ # 检查是否使用 GPU
40
+ print("Is NPL GPU used Preprocessing.py:", spacy.prefer_gpu())
41
+
42
+
43
+ # 使用合适的模型和tokenizer
44
+ model_name = "ProsusAI/finbert" # 选择合适的预训练模型
45
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
46
+ sa_model = AutoModelForSequenceClassification.from_pretrained(model_name)
47
+
48
+ # 初始化情感分析器
49
+ sentiment_analyzer = pipeline('sentiment-analysis', model=sa_model, tokenizer=tokenizer)
50
+
51
+
52
+
53
+
54
+ index_us_stock_index_INX = ak.index_us_stock_sina(symbol=".INX")
55
+ index_us_stock_index_DJI = ak.index_us_stock_sina(symbol=".DJI")
56
+ index_us_stock_index_IXIC = ak.index_us_stock_sina(symbol=".IXIC")
57
+ index_us_stock_index_NDX = ak.index_us_stock_sina(symbol=".NDX")
58
+
59
+
60
+ class LazyWord2Vec:
61
+ def __init__(self, model_path):
62
+ self.model_path = model_path
63
+ self._model = None
64
+
65
+ @property
66
+ def model(self):
67
+ if self._model is None:
68
+ print("Loading Word2Vec model...")
69
+ self._model = KeyedVectors.load(self.model_path, mmap='r')
70
+ return self._model
71
+
72
+ @property
73
+ def vector_size(self):
74
+ self.load_model()
75
+ return self.model.vector_size # 现在你可以正确访问 vector_size 属性
76
+
77
+
78
+ def __getitem__(self, key):
79
+ return self.model[key]
80
+
81
+ def __contains__(self, key):
82
+ return key in self.model
83
+
84
+ # 加载预训练的 Google News Word2Vec 模型
85
+ # 定义路径列表
86
+ search_paths = ["/BuckLake/Model/",
87
+ "/Users/parker/Development/Server/BuckLake/Model/",
88
+ "/Users/liuyue/Work/BuckLake/Model/"]
89
+
90
+ # 获取当前文件所在目录的路径
91
+ current_directory = os.getcwd()
92
+ print(f"Current directory: {current_directory}")
93
+ current_directory = os.path.dirname(os.path.abspath(__file__))
94
+
95
+ # 添加相对于当前项目的路径
96
+ # search_paths.insert(0, os.path.join(current_directory, 'model'))
97
+ search_paths.insert(1, os.path.join(current_directory, '..', 'Model'))
98
+
99
+
100
+ # 定义相对路径
101
+ filename = 'word2vec-google-news-300.model'
102
+
103
+ # 初始化word2vec_path为None
104
+ word2vec_path = None
105
+
106
+ # 遍历路径列表
107
+ for path in search_paths:
108
+ potential_path = os.path.join(path, filename)
109
+ if os.path.exists(potential_path):
110
+ word2vec_path = potential_path
111
+ break
112
+ else:
113
+ print(f"{potential_path} not found.")
114
+
115
+ # 如果找到路径,加载模型
116
+ if word2vec_path:
117
+ print(f"Loading Word2Vec model from {word2vec_path}...")
118
+ word2vec_model = LazyWord2Vec(word2vec_path)
119
+ else:
120
+ raise FileNotFoundError(f"{filename} not found in any of the search paths: {search_paths}")
121
+
122
+
123
+
124
+ def pos_tagging(text):
125
+ try:
126
+ doc = nlp(text)
127
+ tokens, pos_tags, tags = [], [], []
128
+ for token in doc:
129
+ if token.is_punct or token.is_stop:
130
+ continue
131
+ tokens.append(token.text)
132
+ pos_tags.append(token.pos_)
133
+ tags.append(token.tag_)
134
+ except Exception as e:
135
+ print(f"Error in pos_tagging for text: {text[:50]}... Error: {str(e)}")
136
+ return "", "", ""
137
+
138
+ return tokens, pos_tags, tags
139
+
140
+
141
+ # 命名实体识别函数
142
+ def named_entity_recognition(text):
143
+ try:
144
+ doc = nlp(text)
145
+ entities = [(ent.text, ent.label_) for ent in doc.ents]
146
+ except Exception as e:
147
+ print(f"Error in named_entity_recognition for text: {text[:50]}... Error: {str(e)}")
148
+ entities = []
149
+
150
+ return entities or [("", "")]
151
+
152
+
153
+
154
+ # 处理命名实体识别结果
155
+ def process_entities(entities):
156
+ entity_counts = defaultdict(int)
157
+ try:
158
+ for entity in entities:
159
+ etype = entity[1] # 取出实体类型
160
+ entity_counts[etype] += 1 # 直接对实体类型进行计数
161
+
162
+ # 将字典转化为有序的数组
163
+ entity_types = sorted(entity_counts.keys())
164
+ counts = np.array([entity_counts[etype] for etype in entity_types])
165
+ except Exception as e:
166
+ print(f"Error in process_entities: {str(e)}")
167
+ counts = np.zeros(len(entities))
168
+ entity_types = []
169
+
170
+ return counts, entity_types
171
+
172
+
173
+
174
+ # 处理词性标注结果
175
+ def process_pos_tags(pos_tags):
176
+ pos_counts = defaultdict(int)
177
+ try:
178
+ for pos in pos_tags:
179
+ pos_counts[pos[1]] += 1 # 使用POS标签(如NN, VB等)
180
+
181
+ # 将字典转化为有序的数组
182
+ pos_types = sorted(pos_counts.keys())
183
+ counts = np.array([pos_counts[pos] for pos in pos_types])
184
+ except Exception as e:
185
+ print(f"Error in process_pos_tags: {str(e)}")
186
+ counts = np.zeros(len(pos_tags))
187
+ pos_types = []
188
+
189
+ return counts, pos_types
190
+
191
+
192
+
193
+
194
+ # 函数:获取文档向量
195
+ def get_document_vector(words, model = word2vec_model):
196
+ try:
197
+ # 获取每个词的词向量,如果词不在模型中则跳过
198
+ word_vectors = [model[word] for word in words if word in model]
199
+ # 对词向量进行平均,得到文档向量;如果没有词在模型中则返回零向量
200
+ document_vector = np.mean(word_vectors, axis=0) if word_vectors else np.zeros(model.vector_size)
201
+ except Exception as e:
202
+ print(f"Error in get_document_vector for words: {words[:5]}... Error: {str(e)}")
203
+ document_vector = np.zeros(model.vector_size)
204
+
205
+ return document_vector
206
+
207
+
208
+
209
+ # 函数:获取情感得分
210
+ def get_sentiment_score(text):
211
+ try:
212
+ # 直接将原始文本传递给 sentiment_analyzer,它会自动处理 tokenization
213
+ result = sentiment_analyzer(text, truncation=True, max_length=512)[0]
214
+ score = result['score'] if result['label'] == 'positive' else -result['score']
215
+ except Exception as e:
216
+ print(f"Error in get_sentiment_score for text: {text[:50]}... Error: {str(e)}")
217
+ score = 0.0
218
+
219
+ return score
220
+
221
+
222
+
223
+ def get_stock_info(stock_codes, news_date):
224
+ # 获取股票代码和新闻日期
225
+ stock_codes = stock_codes.split(',')
226
+
227
+ news_date = news_date.strftime('%Y%m%d')
228
+ print(f"Getting stock info for {stock_codes} on {news_date}")
229
+
230
+ previous_stock_history = []
231
+ following_stock_history = []
232
+ previous_stock_index_history = []
233
+ following_stock_index_history = []
234
+
235
+ def process_history(stock_history, target_date):
236
+ # 如果数据为空,创建一个空的 DataFrame 并填充为 0
237
+ if stock_history.empty:
238
+ empty_data = pd.DataFrame({
239
+ '开盘': [0] * 4,
240
+ '收盘': [0] * 4,
241
+ '最高': [0] * 4,
242
+ '最低': [0] * 4,
243
+ '成交量': [0] * 4,
244
+ '成交额': [0] * 4
245
+ })
246
+ return empty_data, empty_data
247
+
248
+ # 确保 'date' 列存在
249
+ if 'date' not in stock_history.columns:
250
+ print(f"'date' column not found in stock history. Returning empty data.")
251
+ return pd.DataFrame([[0] * 6] * 4), pd.DataFrame([[0] * 6] * 4)
252
+
253
+ # 将日期转换为 datetime 格式,便于比较
254
+ stock_history['date'] = pd.to_datetime(stock_history['date'])
255
+ target_date = pd.to_datetime(target_date)
256
+
257
+ # 找到目标日期的索引
258
+ target_row = stock_history[stock_history['date'] == target_date]
259
+
260
+ if target_row.empty:
261
+ # 如果目标日期找不到,找到离目标日期最近的日期
262
+ closest_date_index = (stock_history['date'] - target_date).abs().idxmin()
263
+ target_date = stock_history.loc[closest_date_index, 'date']
264
+ target_row = stock_history[stock_history['date'] == target_date]
265
+
266
+ # 确保找到的目标日期有数据
267
+ if target_row.empty:
268
+ return pd.DataFrame([[0] * 6] * 4), pd.DataFrame([[0] * 6] * 4)
269
+
270
+ target_index = target_row.index[0]
271
+ target_pos = stock_history.index.get_loc(target_index)
272
+
273
+ # 取出目标日期及其前3条记录
274
+ previous_rows = stock_history.iloc[max(0, target_pos - 3):target_pos + 1]
275
+
276
+ # 取出目标日期及其后4条记录
277
+ following_rows = stock_history.iloc[target_pos:target_pos + 4]
278
+
279
+ # 删除日期列
280
+ previous_rows = previous_rows.drop(columns=['date'])
281
+ following_rows = following_rows.drop(columns=['date'])
282
+
283
+ # 如果 previous_rows 或 following_rows 的行数不足 4,则填充至 4 行
284
+ if len(previous_rows) < 4:
285
+ previous_rows = previous_rows.reindex(range(4), fill_value=0)
286
+
287
+ if len(following_rows) < 4:
288
+ following_rows = following_rows.reindex(range(4), fill_value=0)
289
+
290
+ # 只返回前4行,并只返回前6列(开盘、收盘、最高、最低、成交量、成交额)
291
+ previous_rows = previous_rows.iloc[:4, :6]
292
+ following_rows = following_rows.iloc[:4, :6]
293
+
294
+ return previous_rows, following_rows
295
+
296
+ if not stock_codes or stock_codes == ['']:
297
+ # 如果 stock_codes 为空,直接获取并返回大盘数据
298
+ stock_index_history = get_stock_index_history("", news_date)
299
+ previous_rows, following_rows = process_history(stock_index_history, news_date)
300
+ previous_stock_index_history.append(previous_rows.values.tolist())
301
+ following_stock_index_history.append(following_rows.values.tolist())
302
+
303
+ # 个股补零逻辑
304
+ previous_stock_history.append([[0] * len(previous_rows.columns)] * len(previous_rows))
305
+ following_stock_history.append([[0] * len(following_rows.columns)] * len(following_rows))
306
+
307
+
308
+
309
+ else:
310
+ for stock_code in stock_codes:
311
+ stock_code = stock_code.strip()
312
+ stock_history = get_stock_history(stock_code, news_date)
313
+ stock_index_history = get_stock_index_history(stock_code, news_date)
314
+
315
+ # 处理个股数据
316
+ previous_rows, following_rows = process_history(stock_history, news_date)
317
+ previous_stock_history.append(previous_rows.values.tolist())
318
+ following_stock_history.append(following_rows.values.tolist())
319
+
320
+ # 处理大盘数据
321
+ previous_rows, following_rows = process_history(stock_index_history, news_date)
322
+ previous_stock_index_history.append(previous_rows.values.tolist())
323
+ following_stock_index_history.append(following_rows.values.tolist())
324
+
325
+ return previous_stock_history, following_stock_history, previous_stock_index_history, following_stock_index_history
326
+
327
+
328
+
329
+ def lemmatized_entry(entry):
330
+ entry_start_time = time.time()
331
+ # Step 1 - 条目聚合
332
+ lemmatized_text = preprocessing_entry(entry)
333
+
334
+
335
+ return lemmatized_text
336
+
337
+
338
+
339
+
340
+
341
+
342
+ # 1. 数据清理
343
+ # 1.1 合并数据
344
+ # 1.2 去除噪声
345
+ # 1.3 大小写转换
346
+ # 1.4 去除停用词
347
+ # 1.5 词汇矫正与拼写检查
348
+ # 1.6 词干提取与词形还原
349
+
350
+
351
+
352
+ # 强制使用 GPU
353
+ # spacy.require_gpu()
354
+
355
+ # 加载模型
356
+ nlp = spacy.load("en_core_web_md")
357
+
358
+ # 检查是否使用 GPU
359
+ print("Is NPL GPU used Lemmatized:", spacy.prefer_gpu())
360
+
361
+
362
+
363
+
364
+ def preprocessing_entry(news_entry):
365
+ """数据清理启动函数
366
+
367
+ Args:
368
+ text (str): preprocessing后的文本
369
+
370
+ Returns:
371
+ [str]]: 词干提取后的String列表
372
+ """
373
+
374
+ # 1.1 合并数据
375
+ text = merge_text(news_entry)
376
+
377
+ # 1.2 去除噪声
378
+ text = disposal_noise(text)
379
+
380
+ # 1.3 大小写转换
381
+ text = text.lower()
382
+
383
+ # 1.4 去除停用词
384
+ text = remove_stopwords(text)
385
+
386
+ # 1.5 拼写检查
387
+ #text = correct_spelling(text)
388
+ #print(f"1.5 拼写检查后的文本:{text}")
389
+
390
+ # 1.6 词干提取与词形还原
391
+ lemmatized_text_list = lemmatize_text(text)
392
+ #print(f"1.6 词干提取与词形还原后的文本:{lemmatized_text_list}")
393
+
394
+ return lemmatized_text_list
395
+
396
+
397
+
398
+ # 1.1 合并数据
399
+ def merge_text(news_entry):
400
+ return news_entry
401
+
402
+
403
+ # 1.2 去除噪声
404
+ def disposal_noise(text):
405
+ # 移除HTML标签
406
+ text = re.sub(r'<.*?>', '', text)
407
+ # 移除URLs
408
+ text = re.sub(r'http\S+|www\S+|https\S+', '', text, flags=re.MULTILINE)
409
+ # 移除方括号内的内容
410
+ # text = re.sub(r'\[.*?\]', '', text)
411
+ # 移除标点符号
412
+ # text = re.sub(r'[^\w\s]', '', text)
413
+ # 移除多余的空格
414
+ text = re.sub(r'\s+', ' ', text).strip()
415
+ # 或者选择性地过滤,例如移除表情符号
416
+ # text = re.sub(r'[^\w\s.,!?]', '', text)
417
+ # 移除换行符和制表符
418
+ text = re.sub(r'[\n\t\r]', ' ', text)
419
+
420
+
421
+ return text
422
+
423
+ # 1.4 去除停用词
424
+
425
+
426
+ def remove_stopwords(text):
427
+ # 使用 spaCy 处理文本
428
+ doc = nlp(text)
429
+ # 去除停用词,并且仅保留标识为“词”(Token.is_alpha)类型的标记
430
+ filtered_sentence = [token.text for token in doc if not token.is_stop and (token.is_alpha or token.like_num)]
431
+ return ' '.join(filtered_sentence)
432
+
433
+
434
+
435
+
436
+
437
+ # 1.5 拼写检查
438
+ # 该函数用于检查输入文本的拼写错误,并修正
439
+ # def correct_spelling(text):
440
+ # corrected_text = []
441
+ # doc = nlp(text)
442
+ # for token in doc:
443
+ # if token.is_alpha: # 仅检查字母构成的单词
444
+ # corrected_word = spell.correction(token.text)
445
+ # if corrected_word is None:
446
+ # # 如果拼写检查没有建议,保留原始单词
447
+ # corrected_word = token.text
448
+ # corrected_text.append(corrected_word)
449
+ # else:
450
+ # corrected_text.append(token.text)
451
+ # return " ".join(corrected_text)
452
+
453
+
454
+ # 1.6 词干提取与词形还原
455
+ # 该函数用于对输入文本进行词形还原,返回一个包含词形还原后单词
456
+ def lemmatize_text(text):
457
+ # 提取词干化后的词
458
+ lemmatized_words = []
459
+ doc = nlp(text) # 需要在这里处理输入文本
460
+ for token in doc:
461
+ # 忽略标点符号和空格
462
+ if not token.is_punct and not token.is_space and (token.is_alpha or token.like_num):
463
+ lemmatized_words.append(token.lemma_)
464
+ return lemmatized_words
465
+
466
+
467
+
468
+
469
+
470
+
471
+ # 2. 数据增强和特征提取
472
+ # 2.1 词性标注(Part-of-Speech Tagging)
473
+ # 为每个词标注其词性(如名词、动词、形容词等),这有助于后续的句法分析和信息提取。
474
+ # 工具:spaCy 或 NLTK
475
+ # 2.2 命名实体识别(NER)
476
+ # 识别文本中的命名实体,如人名、地名、组织机构等,提取出这些实体信息。
477
+ # 工具:spaCy 或 Stanford NER
478
+ # 2.3 句法分析与依存分析
479
+ # 分析句子结构,理解单词之间的关系(如主谓宾结构)。
480
+ # 工具:spaCy 或 NLTK
481
+
482
+
483
+
484
+ # 2 特征提取
485
+
486
+
487
+ # 强制使用 GPU
488
+ #spacy.require_gpu()
489
+
490
+ # 加载模型
491
+ nlp = spacy.load("en_core_web_md")
492
+
493
+ # 检查是否使用 GPU
494
+ print("Is NPL GPU used Enchance_text.py:", spacy.prefer_gpu())
495
+
496
+
497
+
498
+ # 2.3 句法分析与依存分析
499
+ def dependency_parsing(text):
500
+ doc = nlp(text)
501
+ dependencies = []
502
+
503
+ for token in doc:
504
+ # 过滤标点符号和停用词,或其他不需要的词性
505
+ if token.is_punct or token.is_stop:
506
+ continue
507
+
508
+ # 可以进一步根据特定的依存关系类型过滤结果
509
+ # 常见的依存关系类型: 'nsubj' (名词主语), 'dobj' (直接宾语), 等等
510
+ # if token.dep_ not in {'nsubj', 'dobj', ...}:
511
+ # continue
512
+
513
+ dependencies.append((token.text, token.dep_, token.head.text))
514
+
515
+ return dependencies
516
+
517
+
518
+
519
+ def processing_entry(entry):
520
+ # print(f"processing_entry: {entry}")
521
+
522
+
523
+ lemmatized_entry = preprocessing_entry(entry)
524
+ # print(f"lemmatized_entry: {lemmatized_entry}")
525
+
526
+ cleaned_text = disposal_noise(entry)
527
+ # print(f"disposal_noise: {cleaned_text}")
528
+
529
+ pos_tag = pos_tagging(cleaned_text)
530
+ # print(f"pos_tagging: {db_pos_tag}")
531
+
532
+ ner = named_entity_recognition(cleaned_text)
533
+ # print(f"named_entity_recognition: {db_ner}")
534
+
535
+ dependency_parsed = dependency_parsing(cleaned_text)
536
+ # print(f"dependency_parsing: {db_dependency_parsing}")
537
+
538
+ sentiment_score = get_sentiment_score(cleaned_text)
539
+ # print(f"sentiment_score: {sentiment_score}")
540
+
541
+
542
+
543
+
544
+ return (lemmatized_entry, pos_tag, ner, dependency_parsed, sentiment_score)
requirements.txt CHANGED
@@ -1,3 +1,10 @@
1
- flask
2
  streamlit
3
- transformers
 
 
 
 
 
 
 
 
 
 
1
  streamlit
2
+ transformers
3
+ akshare
4
+ blis==0.7.11
5
+ spacy==3.7.5
6
+ gensim
7
+ numpy
8
+ fastapi
9
+ uvicorn
10
+ gensim
us_stock.py ADDED
@@ -0,0 +1,361 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import logging
2
+ import re
3
+ import akshare as ak
4
+ import pandas as pd
5
+ from datetime import datetime, timedelta
6
+ import time # 导入标准库的 time 模块
7
+
8
+ import os
9
+
10
+ import requests
11
+ import threading
12
+ import asyncio
13
+
14
+
15
+ logging.basicConfig(level=logging.INFO)
16
+
17
+
18
+ # 获取当前文件的目录
19
+ base_dir = os.path.dirname(os.path.abspath(__file__))
20
+
21
+ # 构建CSV文件的绝对路径
22
+ nasdaq_100_path = os.path.join(base_dir, '../model/nasdaq100.csv')
23
+ dow_jones_path = os.path.join(base_dir, '../model/dji.csv')
24
+ sp500_path = os.path.join(base_dir, '../model/sp500.csv')
25
+ nasdaq_composite_path = os.path.join(base_dir, '../model/nasdaq_all.csv')
26
+ # 从CSV文件加载成分股数据
27
+ nasdaq_100_stocks = pd.read_csv(nasdaq_100_path)
28
+ dow_jones_stocks = pd.read_csv(dow_jones_path)
29
+ sp500_stocks = pd.read_csv(sp500_path)
30
+ nasdaq_composite_stocks = pd.read_csv(nasdaq_composite_path)
31
+
32
+
33
+ def fetch_stock_us_spot_data_with_retries():
34
+ # 定义重试间隔时间序列(秒)
35
+ retry_intervals = [10, 20, 60, 300, 600]
36
+ retry_index = 0 # 初始重试序号
37
+
38
+ while True:
39
+ try:
40
+ # 尝试获取API数据
41
+ symbols = ak.stock_us_spot_em()
42
+ return symbols # 成功获取数据后返回
43
+
44
+ except Exception as e:
45
+ print(f"Error fetching data: {e}")
46
+
47
+ # 获取当前重试等待时间
48
+ wait_time = retry_intervals[retry_index]
49
+ print(f"Retrying in {wait_time} seconds...")
50
+ time.sleep(wait_time) # 等待指定的秒数
51
+
52
+ # 更新重试索引,但不要超出重试时间列表的范围
53
+ retry_index = min(retry_index + 1, len(retry_intervals) - 1)
54
+
55
+
56
+
57
+ async def fetch_stock_us_spot_data_with_retries_async():
58
+ retry_intervals = [10, 20, 60, 300, 600]
59
+ retry_index = 0
60
+
61
+ while True:
62
+ try:
63
+ symbols = await asyncio.to_thread(ak.stock_us_spot_em)
64
+ return symbols
65
+ except Exception as e:
66
+ print(f"Error fetching data: {e}")
67
+ wait_time = retry_intervals[retry_index]
68
+ print(f"Retrying in {wait_time} seconds...")
69
+ await asyncio.sleep(wait_time)
70
+ retry_index = min(retry_index + 1, len(retry_intervals) - 1)
71
+
72
+ symbols = asyncio.run(fetch_stock_us_spot_data_with_retries_async())
73
+
74
+
75
+ # 全局变量
76
+ index_us_stock_index_INX = None
77
+ index_us_stock_index_DJI = None
78
+ index_us_stock_index_IXIC = None
79
+ index_us_stock_index_NDX = None
80
+
81
+ def update_stock_indices():
82
+ global index_us_stock_index_INX, index_us_stock_index_DJI, index_us_stock_index_IXIC, index_us_stock_index_NDX
83
+ try:
84
+ index_us_stock_index_INX = ak.index_us_stock_sina(symbol=".INX")
85
+ index_us_stock_index_DJI = ak.index_us_stock_sina(symbol=".DJI")
86
+ index_us_stock_index_IXIC = ak.index_us_stock_sina(symbol=".IXIC")
87
+ index_us_stock_index_NDX = ak.index_us_stock_sina(symbol=".NDX")
88
+ print("Stock indices updated")
89
+ except Exception as e:
90
+ print(f"Error updating stock indices: {e}")
91
+
92
+ # 设置定时器,每隔12小时更新一次
93
+ threading.Timer(12 * 60 * 60, update_stock_indices).start()
94
+
95
+ # 程序开始时立即更新一次
96
+ update_stock_indices()
97
+
98
+
99
+ # 创建列名转换的字典
100
+ column_mapping = {
101
+ '日期': 'date',
102
+ '开盘': 'open',
103
+ '收盘': 'close',
104
+ '最高': 'high',
105
+ '最低': 'low',
106
+ '成交量': 'volume',
107
+ '成交额': 'amount',
108
+ '振幅': 'amplitude',
109
+ '涨跌幅': 'price_change_percentage',
110
+ '涨跌额': 'price_change_amount',
111
+ '换手率': 'turnover_rate'
112
+ }
113
+
114
+ # 定义一个标准的列顺序
115
+ standard_columns = ['date', 'open', 'close', 'high', 'low', 'volume', 'amount']
116
+
117
+
118
+ # 定义查找函数
119
+ def find_stock_entry(stock_code):
120
+ # 使用 str.endswith 来匹配股票代码
121
+ matching_row = symbols[symbols['代码'].str.endswith(stock_code)]
122
+ # print(symbols)
123
+ if not matching_row.empty:
124
+ # print(f"股票代码 {stock_code} 找到, 代码为 {matching_row['代码'].values[0]}")
125
+ return matching_row['代码'].values[0]
126
+ else:
127
+ return ""
128
+
129
+ '''
130
+ # 示例调用
131
+ # 测试函数
132
+ result = find_stock_entry('AAPL')
133
+
134
+ if isinstance(result, pd.DataFrame) and not result.empty:
135
+ # 如果找到的结果不为空,获取代码列的值
136
+ code_value = result['代码'].values[0]
137
+ print(code_value)
138
+ else:
139
+ print(result)
140
+ '''
141
+
142
+
143
+ def reduce_columns(df, columns_to_keep):
144
+ return df[columns_to_keep]
145
+
146
+
147
+ # 返回个股历史数据
148
+ def get_stock_history(symbol, news_date, retries=10):
149
+ # 定义重试间隔时间序列(秒)
150
+ retry_intervals = [10, 20, 60, 300, 600]
151
+ retry_count = 0
152
+
153
+ # 如果传入的symbol不包含数字前缀,则通过 find_stock_entry 获取完整的symbol
154
+ if not any(char.isdigit() for char in symbol):
155
+ full_symbol = find_stock_entry(symbol)
156
+ if len(symbol) != 0 and full_symbol:
157
+ symbol = full_symbol
158
+ else:
159
+ symbol = ""
160
+
161
+
162
+ # 将news_date转换为datetime对象
163
+ news_date_dt = datetime.strptime(news_date, "%Y%m%d")
164
+
165
+ # 计算start_date和end_date
166
+ start_date = (news_date_dt - timedelta(weeks=2)).strftime("%Y%m%d")
167
+ end_date = (news_date_dt + timedelta(weeks=2)).strftime("%Y%m%d")
168
+
169
+ stock_hist_df = None
170
+ retry_index = 0 # 初始化重试索引
171
+
172
+ while retry_count <= retries and len(symbol) != 0: # 无限循环重试
173
+ try:
174
+ # 尝试获取API数据
175
+ stock_hist_df = ak.stock_us_hist(symbol=symbol, period="daily", start_date=start_date, end_date=end_date, adjust="")
176
+
177
+ if stock_hist_df.empty: # 检查是否为空数据
178
+ # print(f"No data for {symbol} on {news_date}.")
179
+ stock_hist_df = None # 将 DataFrame 设置为 None
180
+ break
181
+
182
+
183
+ except (requests.exceptions.Timeout, ConnectionError) as e:
184
+ print(f"Request timed out: {e}. Retrying...")
185
+ retry_count += 1 # 增加重试次数
186
+ continue
187
+
188
+
189
+ except (TypeError, ValueError, BaseException) as e:
190
+ print(f"Error {e} scraping data for {symbol} on {news_date}. Break...")
191
+ # 可能是没数据,直接Break
192
+ break
193
+
194
+ # 如果发生异常,等待一段时间再重试
195
+ wait_time = retry_intervals[retry_index]
196
+ print(f"Waiting for {wait_time} seconds before retrying...")
197
+ time.sleep(wait_time)
198
+ retry_index = (retry_index + 1) if retry_index < len(retry_intervals) - 1 else retry_index # 更新重试索引,不超过列表长度
199
+
200
+ # 如果获取失败或数据为空,返回填充为0的 DataFrame
201
+ if stock_hist_df is None or stock_hist_df.empty:
202
+ # 构建一个空的 DataFrame,包含指定日期范围的空数据
203
+ date_range = pd.date_range(start=start_date, end=end_date)
204
+ stock_hist_df = pd.DataFrame({
205
+ 'date': date_range,
206
+ '开盘': 0,
207
+ '收盘': 0,
208
+ '最高': 0,
209
+ '最低': 0,
210
+ '成交量': 0,
211
+ '成交额': 0,
212
+ '振幅': 0,
213
+ '涨跌幅': 0,
214
+ '涨跌额': 0,
215
+ '换手率': 0
216
+ })
217
+
218
+ # 使用rename方法转换列名
219
+ stock_hist_df = stock_hist_df.rename(columns=column_mapping)
220
+ stock_hist_df = stock_hist_df.reindex(columns=standard_columns)
221
+ # 处理个股数据,保留所需列
222
+ stock_hist_df = reduce_columns(stock_hist_df, standard_columns)
223
+ return stock_hist_df
224
+
225
+ # 统一列名
226
+ stock_hist_df = stock_hist_df.rename(columns=column_mapping)
227
+ stock_hist_df = stock_hist_df.reindex(columns=standard_columns)
228
+ # 处理个股数据,保留所需列
229
+ stock_hist_df = reduce_columns(stock_hist_df, standard_columns)
230
+ return stock_hist_df
231
+
232
+
233
+ '''
234
+ # 示例调用
235
+ result = get_stock_history('AAPL', '20240214')
236
+ print(result)
237
+ '''
238
+ # result = get_stock_history('ATMU', '20231218')
239
+ # print(result)
240
+
241
+
242
+ # 返回个股所属指数历史数据
243
+ def get_stock_index_history(symbol, news_date):
244
+ # 检查股票所属的指数
245
+ if symbol in nasdaq_100_stocks['Symbol'].values:
246
+ index_code = ".NDX"
247
+ index_data = index_us_stock_index_NDX
248
+ elif symbol in dow_jones_stocks['Symbol'].values:
249
+ index_code = ".DJI"
250
+ index_data = index_us_stock_index_DJI
251
+ elif symbol in sp500_stocks['Symbol'].values:
252
+ index_code = ".INX"
253
+ index_data = index_us_stock_index_INX
254
+ elif symbol in nasdaq_composite_stocks["Symbol"].values or symbol is None or symbol == "":
255
+ index_code = ".IXIC"
256
+ index_data = index_us_stock_index_IXIC
257
+ else:
258
+
259
+ index_code = ".IXIC"
260
+ index_data = index_us_stock_index_IXIC
261
+
262
+ # print(f"股票代码 {symbol} 不属于纳斯达克100、道琼斯工业、标准普尔500或纳斯达克综合指数。")
263
+ # 将 news_date 转换为 datetime 对象
264
+ news_date_dt = datetime.strptime(news_date, "%Y%m%d")
265
+
266
+ # 计算 start_date 和 end_date
267
+ start_date = (news_date_dt - timedelta(weeks=2)).strftime("%Y-%m-%d")
268
+ end_date = (news_date_dt + timedelta(weeks=2)).strftime("%Y-%m-%d")
269
+
270
+ # 构建一个空的 DataFrame,包含指定日期范围的空数据
271
+ date_range = pd.date_range(start=start_date, end=end_date)
272
+ stock_hist_df = pd.DataFrame({
273
+ 'date': date_range,
274
+ 'open': 0,
275
+ 'high': 0,
276
+ 'low': 0,
277
+ 'close': 0,
278
+ 'volume': 0,
279
+ 'amount': 0
280
+ })
281
+ # 统一列名
282
+ stock_hist_df = stock_hist_df.rename(columns=column_mapping)
283
+ stock_hist_df = stock_hist_df.reindex(columns=standard_columns)
284
+ # 处理个股数据,保留所需列
285
+ stock_hist_df = reduce_columns(stock_hist_df, standard_columns)
286
+ return stock_hist_df
287
+
288
+ # 将 news_date 转换为 datetime 对象
289
+ news_date_dt = datetime.strptime(news_date, "%Y%m%d")
290
+
291
+ # 计算 start_date 和 end_date
292
+ start_date = (news_date_dt - timedelta(weeks=2)).strftime("%Y-%m-%d")
293
+ end_date = (news_date_dt + timedelta(weeks=2)).strftime("%Y-%m-%d")
294
+
295
+ # 确保 index_data['date'] 是 datetime 类型
296
+ index_data['date'] = pd.to_datetime(index_data['date'])
297
+
298
+ # 从指数历史数据中提取指定日期范围的数据
299
+ index_hist_df = index_data[(index_data['date'] >= start_date) & (index_data['date'] <= end_date)]
300
+
301
+ # 统一列名
302
+ index_hist_df = index_hist_df.rename(columns=column_mapping)
303
+ index_hist_df = index_hist_df.reindex(columns=standard_columns)
304
+ # 处理个股数据,保留所需列
305
+ index_hist_df = reduce_columns(index_hist_df, standard_columns)
306
+ return index_hist_df
307
+ '''
308
+ # 示例调用
309
+ result = get_stock_index_history('AAPL', '20240214')
310
+ print(result)
311
+ '''
312
+
313
+
314
+
315
+ def find_stock_codes_or_names(entities):
316
+ """
317
+ 从给定的实体列表中检索股票代码或公司名称。
318
+
319
+ :param entities: 命名实体识别结果列表,格式为 [('实体名称', '实体类型'), ...]
320
+ :return: 相关的股票代码列表
321
+ """
322
+ stock_codes = set()
323
+
324
+ # 合并所有股票字典并清理数据,确保都是字符串
325
+ all_symbols = pd.concat([nasdaq_100_stocks['Symbol'],
326
+ dow_jones_stocks['Symbol'],
327
+ sp500_stocks['Symbol'],
328
+ nasdaq_composite_stocks['Symbol']]).dropna().astype(str).unique().tolist()
329
+
330
+ all_names = pd.concat([nasdaq_100_stocks['Name'],
331
+ nasdaq_composite_stocks['Name'],
332
+ sp500_stocks['Security'],
333
+ dow_jones_stocks['Company']]).dropna().astype(str).unique().tolist()
334
+
335
+ # 创建一个 Name 到 Symbol 的映射
336
+ name_to_symbol = {}
337
+ for idx, name in enumerate(all_names):
338
+ if idx < len(all_symbols):
339
+ symbol = all_symbols[idx]
340
+ name_to_symbol[name.lower()] = symbol
341
+
342
+ # 查找实体映射到的股票代码
343
+ for entity, entity_type in entities:
344
+ entity_lower = entity.lower()
345
+ entity_upper = entity.upper()
346
+
347
+ # 检查 Symbol 列
348
+ if entity_upper in all_symbols:
349
+ stock_codes.add(entity_upper)
350
+ print(f"Matched symbol: {entity_upper}")
351
+
352
+ # 检查 Name 列,确保完整匹配而不是部分匹配
353
+ for name, symbol in name_to_symbol.items():
354
+ # 使用正则表达式进行严格匹配
355
+ pattern = rf'\b{re.escape(entity_lower)}\b'
356
+ if re.search(pattern, name):
357
+ stock_codes.add(symbol.upper())
358
+ print(f"Matched name/company: '{entity_lower}' in '{name}' -> {symbol.upper()}")
359
+
360
+ print(f"Stock codes found: {stock_codes}")
361
+ return list(stock_codes)