Warning: mkdir(): No space left on device in /var/www/group-telegram/post.php on line 37

Warning: file_put_contents(aCache/aDaily/post/c0ldness/--): Failed to open stream: No such file or directory in /var/www/group-telegram/post.php on line 50
ХОЛОДНЫЙ РАСЧЕТ ∅ | Telegram Webview: c0ldness/5934 -
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



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: |

Despite Telegram's origins, its approach to users' security has privacy advocates worried. At this point, however, Durov had already been working on Telegram with his brother, and further planned a mobile-first social network with an explicit focus on anti-censorship. Later in April, he told TechCrunch that he had left Russia and had “no plans to go back,” saying that the nation was currently “incompatible with internet business at the moment.” He added later that he was looking for a country that matched his libertarian ideals to base his next startup. "And that set off kind of a battle royale for control of the platform that Durov eventually lost," said Nathalie Maréchal of the Washington advocacy group Ranking Digital Rights. Again, in contrast to Facebook, Google and Twitter, Telegram's founder Pavel Durov runs his company in relative secrecy from Dubai. Stocks closed in the red Friday as investors weighed upbeat remarks from Russian President Vladimir Putin about diplomatic discussions with Ukraine against a weaker-than-expected print on U.S. consumer sentiment.
from hk


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