Spaces:
Build error
Build error
Update variables.py
Browse files- variables.py +2 -132
variables.py
CHANGED
|
@@ -94,7 +94,7 @@ def create_vectorstore(file,model):
|
|
| 94 |
|
| 95 |
|
| 96 |
@st.experimental_singleton(suppress_st_warning=True)
|
| 97 |
-
def embed_tweets(query,_prompt):
|
| 98 |
'''Process file with latest tweets'''
|
| 99 |
|
| 100 |
|
|
@@ -102,7 +102,7 @@ def embed_tweets(query,_prompt):
|
|
| 102 |
chain = VectorDBQA.from_chain_type(
|
| 103 |
ChatOpenAI(temperature=0),
|
| 104 |
chain_type="stuff",
|
| 105 |
-
vectorstore=
|
| 106 |
chain_type_kwargs=chain_type_kwargs,
|
| 107 |
return_source_documents=True,
|
| 108 |
k=3
|
|
@@ -145,136 +145,6 @@ topics = {
|
|
| 145 |
"19": "Stock Movement",
|
| 146 |
}
|
| 147 |
|
| 148 |
-
user_name = [
|
| 149 |
-
"Investing.com",
|
| 150 |
-
"(((The Daily Shot)))",
|
| 151 |
-
"Bloomberg Markets",
|
| 152 |
-
"FirstSquawk",
|
| 153 |
-
"MarketWatch",
|
| 154 |
-
"markets",
|
| 155 |
-
"FinancialTimes",
|
| 156 |
-
"CNBC",
|
| 157 |
-
"ReutersBiz",
|
| 158 |
-
"BreakingNews",
|
| 159 |
-
"LiveSquawk",
|
| 160 |
-
"NYSE",
|
| 161 |
-
"WSJmarkets",
|
| 162 |
-
"FT",
|
| 163 |
-
"TheStreet",
|
| 164 |
-
"ftfinancenews",
|
| 165 |
-
"BloombergTV",
|
| 166 |
-
"Nasdaq",
|
| 167 |
-
"NYSE",
|
| 168 |
-
"federalreserve",
|
| 169 |
-
"NewYorkFed",
|
| 170 |
-
"sffed",
|
| 171 |
-
"WSJCentralBanks",
|
| 172 |
-
"RichmondFed",
|
| 173 |
-
"ecb",
|
| 174 |
-
"stlouisfed",
|
| 175 |
-
"WorldBank",
|
| 176 |
-
"MarketCurrents",
|
| 177 |
-
"OpenOutcrier",
|
| 178 |
-
"BullTradeFinder",
|
| 179 |
-
"WallStChatter",
|
| 180 |
-
"Briefingcom",
|
| 181 |
-
"SeekingAlpha",
|
| 182 |
-
"realDonaldTrump",
|
| 183 |
-
"AswathDamodaran",
|
| 184 |
-
"ukarlewitz",
|
| 185 |
-
"alphatrends",
|
| 186 |
-
"Investor666",
|
| 187 |
-
"ACInvestorBlog",
|
| 188 |
-
"ZorTrades",
|
| 189 |
-
"ScottNations",
|
| 190 |
-
"TradersCorner",
|
| 191 |
-
"TraderGoalieOne",
|
| 192 |
-
"option_snipper",
|
| 193 |
-
"jasonleavitt",
|
| 194 |
-
"LMT978",
|
| 195 |
-
"OptionsHawk",
|
| 196 |
-
"andrewbtodd",
|
| 197 |
-
"Terri1618",
|
| 198 |
-
"SunriseTrader",
|
| 199 |
-
"traderstewie",
|
| 200 |
-
"TMLTrader",
|
| 201 |
-
"IncredibleTrade",
|
| 202 |
-
"NYFedResearch",
|
| 203 |
-
"YahooFinance",
|
| 204 |
-
"business",
|
| 205 |
-
"economics",
|
| 206 |
-
"IMFNews",
|
| 207 |
-
"Market_Screener",
|
| 208 |
-
"QuickTake",
|
| 209 |
-
"NewsFromBW",
|
| 210 |
-
"BNCommodities",
|
| 211 |
-
]
|
| 212 |
-
|
| 213 |
-
user_id = [
|
| 214 |
-
"988955288",
|
| 215 |
-
"423769635",
|
| 216 |
-
"69620713",
|
| 217 |
-
"59393368",
|
| 218 |
-
"3295423333",
|
| 219 |
-
"624413",
|
| 220 |
-
"69620713",
|
| 221 |
-
"4898091",
|
| 222 |
-
"20402945",
|
| 223 |
-
"15110357",
|
| 224 |
-
"6017542",
|
| 225 |
-
"21323268",
|
| 226 |
-
"28164923",
|
| 227 |
-
"18949452",
|
| 228 |
-
"15281391",
|
| 229 |
-
"11014272",
|
| 230 |
-
"35002876",
|
| 231 |
-
"18639734",
|
| 232 |
-
"21323268",
|
| 233 |
-
"26538229",
|
| 234 |
-
"15072071",
|
| 235 |
-
"117237387",
|
| 236 |
-
"327484803",
|
| 237 |
-
"16532451",
|
| 238 |
-
"83466368",
|
| 239 |
-
"71567590",
|
| 240 |
-
"27860681",
|
| 241 |
-
"15296897",
|
| 242 |
-
"2334614718",
|
| 243 |
-
"2222635612",
|
| 244 |
-
"3382363841",
|
| 245 |
-
"72928001",
|
| 246 |
-
"23059499",
|
| 247 |
-
"25073877",
|
| 248 |
-
"33216611",
|
| 249 |
-
"37284991",
|
| 250 |
-
"15246621",
|
| 251 |
-
"293458690",
|
| 252 |
-
"55561590",
|
| 253 |
-
"18560146",
|
| 254 |
-
"244978426",
|
| 255 |
-
"85523269",
|
| 256 |
-
"276714687",
|
| 257 |
-
"2806294664",
|
| 258 |
-
"16205561",
|
| 259 |
-
"1064700308",
|
| 260 |
-
"61342056",
|
| 261 |
-
"184126162",
|
| 262 |
-
"405820375",
|
| 263 |
-
"787439438964068352",
|
| 264 |
-
"52166809",
|
| 265 |
-
"2715646770",
|
| 266 |
-
"47247213",
|
| 267 |
-
"374672240",
|
| 268 |
-
"19546277",
|
| 269 |
-
"34713362",
|
| 270 |
-
"144274618",
|
| 271 |
-
"25098482",
|
| 272 |
-
"102325185",
|
| 273 |
-
"252751061",
|
| 274 |
-
"976297820532518914",
|
| 275 |
-
"804556370",
|
| 276 |
-
]
|
| 277 |
-
|
| 278 |
sentiment_classifier, topic_classifier = load_models()
|
| 279 |
|
| 280 |
def convert_user_names(user_name: list):
|
|
|
|
| 94 |
|
| 95 |
|
| 96 |
@st.experimental_singleton(suppress_st_warning=True)
|
| 97 |
+
def embed_tweets(query,_prompt,_docsearch):
|
| 98 |
'''Process file with latest tweets'''
|
| 99 |
|
| 100 |
|
|
|
|
| 102 |
chain = VectorDBQA.from_chain_type(
|
| 103 |
ChatOpenAI(temperature=0),
|
| 104 |
chain_type="stuff",
|
| 105 |
+
vectorstore=_docsearch,
|
| 106 |
chain_type_kwargs=chain_type_kwargs,
|
| 107 |
return_source_documents=True,
|
| 108 |
k=3
|
|
|
|
| 145 |
"19": "Stock Movement",
|
| 146 |
}
|
| 147 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 148 |
sentiment_classifier, topic_classifier = load_models()
|
| 149 |
|
| 150 |
def convert_user_names(user_name: list):
|