EMV指标 EMV(Ease of Movement Value)由技术分析专家理查德・阿姆斯(Richard W. Arms Jr.)于 1970 年代提出,是一种结合价格波动与成交量的技术指标。其核心逻辑是:在成交量放大时,价格波动应更显著;若成交量小而价格波动大,则可能预示趋势乏力。EMV 通过量化 “价格移动的难易程度”,判断市场趋势的动能强弱,尤其适用于识别量价配合的真实趋势。
CREATE TABLE public.fy_article_part_index (
fy_article_part_id serial4 NOT NULL,
fy_article_info_id int4 NOT NULL,
article_part_text text NOT NULL,
article_part_ts tsvector NOT NULL,
article_part_em public.vector NOT NULL,
CONSTRAINT fy_article_part_index_pk PRIMARY KEY (fy_article_part_id)
);
CREATE INDEX fy_article_part_ts_index ON public.fy_article_part_index USING rum (article_part_ts);
SELECT fy_article_info_id, article_part_ts <=> to_tsquery('jiebacfg', %s) AS rank
FROM fy_article_part_index
WHERE article_part_ts @@ to_tsquery('jiebacfg', %s)
ORDER BY rank
LIMIT 100
from nltk.tokenize import sent_tokenize
sentences = sent_tokenize(article_en)
对于中文,没有找到现成的分句方法,就自己实现了一个,考虑了一些特殊情况
def split_chinese_sentences(text):
sentences = []
current_sentence = []
i = 0
n = len(text)
# 状态跟踪
in_quote = False # 是否在引号中
quote_chars = {'“': '”', '‘': '’'} # 对应的引号匹配
while i < n:
char = text[i]
# 处理引号状态
if char in quote_chars:
# 遇到开引号,进入引号状态
current_sentence.append(char)
expected_end_quote = quote_chars[char]
i += 1
# 寻找对应的闭引号
while i < n and text[i] != expected_end_quote:
current_sentence.append(text[i])
i += 1
if i < n:
current_sentence.append(text[i]) # 添加闭引号
i += 1
continue
# 处理省略号(六连点)
if i <= n-5 and text[i:i+6] == '......':
current_sentence.append('......')
if not in_quote:
sentences.append(''.join(current_sentence).strip())
current_sentence = []
i += 6
continue
# 处理中文省略号(三连顿号)
if i <= n-2 and text[i] == '⋯' and text[i+1] == '⋯' and text[i+2] == '⋯':
current_sentence.append('⋯⋯⋯')
if not in_quote:
sentences.append(''.join(current_sentence).strip())
current_sentence = []
i += 3
continue
# 处理普通结束符
if char in {'。', '!', '?', '…'}:
current_sentence.append(char)
if not in_quote:
sentences.append(''.join(current_sentence).strip())
current_sentence = []
i += 1
continue
# 默认情况:积累字符
current_sentence.append(char)
i += 1
# 处理最后未完结的句子
if current_sentence:
sentences.append(''.join(current_sentence).strip())
return [s for s in sentences if s]