Telegram Group & Telegram Channel
ХОЛОДНЫЙ РАСЧЕТ ∅
💀 NLP-индексы: Зачем? Когда мы пытаемся понять последствия некоторого события для рынков, то стандартный инструмент - это событийный анализ/event study: например, мы собираем базу дат класса событий (встреч представителей стран, санкций и т.п.) и смотрим…
💀 NLP-индексы: Рецепт

Сделаем чистый env под наш расчет:

conda create -n top2vec python=3.10
pip install top2vec[sentence-transformers]


Предположим, что у нас уже собран весь нужный массив текстов в чем-то вроде

df_txt = pd.DataFrame(columns=['ds','Para'])


Берем вектор текстов

li_doc = df_txt.Para.to_list()


Находим кластеры тем:

top2vec_model = Top2Vec(documents=li_doc
, ngram_vocab=True
, embedding_model='all-MiniLM-L6-v2'
, use_embedding_model_tokenizer=True
, contextual_top2vec=True
)

Обычно находится слишком много - можем сократить / огрубить кластеры до каких-то человеческих величин:

top2vec_model.hierarchical_topic_reduction(20)


Далее смотрим на ключевые слова по темам и выбираем те, которые отражают интересный для нас феномен:

topic_words, word_scores, topic_nums = top2vec_model.get_topics(reduced=True)
[', '.join(x[:10]) + "\n\n\m" for x in topic_words.tolist()]


Посмотрев на ключевые слова выбираем нужные нам кластеры, которые относятся к целевой теме:

li_top = [1,13,...]

Наконец, строим индекс
df_ix = df_txt\
.assign(
ix_all = 1
, top = top2vec_model.doc_top_reduced
, ix_top = lambda df: df.top.map(lambda x: 1 if x in li_top else 0)
)\
.set_index('ds')\
[['ix','ix_top']]\
.resample('M').sum()\
.assign(ix_top_pct = lambda df: df.ix_top.div(ix_all).mul(100)
)


Готово - можем смотреть на любые статистические свойства индекса (как быстро он угасает после пиков), сравнивать текущую интенсивность с историческими эпизодами, смотреть как его значение соотносятся с рыночными показателями

@c0ldness
Please open Telegram to view this post
VIEW IN TELEGRAM
🔥32🫡7



group-telegram.com/c0ldness/5934
Create:
Last Update:

💀 NLP-индексы: Рецепт

Сделаем чистый env под наш расчет:

conda create -n top2vec python=3.10
pip install top2vec[sentence-transformers]


Предположим, что у нас уже собран весь нужный массив текстов в чем-то вроде

df_txt = pd.DataFrame(columns=['ds','Para'])


Берем вектор текстов

li_doc = df_txt.Para.to_list()


Находим кластеры тем:

top2vec_model = Top2Vec(documents=li_doc
, ngram_vocab=True
, embedding_model='all-MiniLM-L6-v2'
, use_embedding_model_tokenizer=True
, contextual_top2vec=True
)

Обычно находится слишком много - можем сократить / огрубить кластеры до каких-то человеческих величин:

top2vec_model.hierarchical_topic_reduction(20)


Далее смотрим на ключевые слова по темам и выбираем те, которые отражают интересный для нас феномен:

topic_words, word_scores, topic_nums = top2vec_model.get_topics(reduced=True)
[', '.join(x[:10]) + "\n\n\m" for x in topic_words.tolist()]


Посмотрев на ключевые слова выбираем нужные нам кластеры, которые относятся к целевой теме:

li_top = [1,13,...]

Наконец, строим индекс
df_ix = df_txt\
.assign(
ix_all = 1
, top = top2vec_model.doc_top_reduced
, ix_top = lambda df: df.top.map(lambda x: 1 if x in li_top else 0)
)\
.set_index('ds')\
[['ix','ix_top']]\
.resample('M').sum()\
.assign(ix_top_pct = lambda df: df.ix_top.div(ix_all).mul(100)
)


Готово - можем смотреть на любые статистические свойства индекса (как быстро он угасает после пиков), сравнивать текущую интенсивность с историческими эпизодами, смотреть как его значение соотносятся с рыночными показателями

@c0ldness

BY ХОЛОДНЫЙ РАСЧЕТ ∅




Share with your friend now:
group-telegram.com/c0ldness/5934

View MORE
Open in Telegram


Telegram | DID YOU KNOW?

Date: |

The picture was mixed overseas. Hong Kong’s Hang Seng Index fell 1.6%, under pressure from U.S. regulatory scrutiny on New York-listed Chinese companies. Stocks were more buoyant in Europe, where Frankfurt’s DAX surged 1.4%. Telegram boasts 500 million users, who share information individually and in groups in relative security. But Telegram's use as a one-way broadcast channel — which followers can join but not reply to — means content from inauthentic accounts can easily reach large, captive and eager audiences. The account, "War on Fakes," was created on February 24, the same day Russian President Vladimir Putin announced a "special military operation" and troops began invading Ukraine. The page is rife with disinformation, according to The Atlantic Council's Digital Forensic Research Lab, which studies digital extremism and published a report examining the channel. Telegram has gained a reputation as the “secure” communications app in the post-Soviet states, but whenever you make choices about your digital security, it’s important to start by asking yourself, “What exactly am I securing? And who am I securing it from?” These questions should inform your decisions about whether you are using the right tool or platform for your digital security needs. Telegram is certainly not the most secure messaging app on the market right now. Its security model requires users to place a great deal of trust in Telegram’s ability to protect user data. For some users, this may be good enough for now. For others, it may be wiser to move to a different platform for certain kinds of high-risk communications. The perpetrators use various names to carry out the investment scams. They may also impersonate or clone licensed capital market intermediaries by using the names, logos, credentials, websites and other details of the legitimate entities to promote the illegal schemes.
from us


Telegram ХОЛОДНЫЙ РАСЧЕТ ∅
FROM American