首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏Michael阿明学习之路

    LeetCode 1181. 前后拼接(哈希map)

    返回每两个「短语」 phrases[i] 和 phrases[j](i != j)进行「前后拼接」得到的「新短语」。 注意,两个「短语」拼接时的顺序也很重要,我们需要同时考虑这两个「短语」。 示例 1: 输入:phrases = ["writing code","code rocks"] 输出:["writing code rocks"] 示例 2: 输入:phrases = ["mission = ["a","b","a"] 输出:["a"] 提示: 1 <= phrases.length <= 100 1 <= phrases[i].length <= 100 来源:力扣(LeetCode (); ++i) { idx1 = phrases[i].find_first_of(' ');//第一个空格 idx2 = phrases[i].find_last_of = string::npos) back[phrases[i].substr(idx2+1)].push_back(i); else back[phrases[i

    51110发布于 2021-02-19
  • 来自专栏自然语言处理

    【NLP基础】英文关键词抽取RAKE算法

    (tokens: List[str], stoplist: List[str] = None) -> List[str]: """ Merge tokens into phrases, (' '.join(current_phrase)) return all_phrases def get_cooccurrence_graph(phrases: List[str]) -> : Set[str] = set() ranked_phrases: List[Tuple[str, float]] = [] for phrase in phrases: ranked_phrases.sort(key=lambda item: (-item[1], item[0])) return ranked_phrases def rake_text(text (cooccurrence) ranked_result: List[Tuple[str, float]] = get_ranked_phrases(phrases, degrees=degrees

    1.3K10编辑于 2022-09-23
  • 来自专栏Web开发之路

    i18n 简易版

    在这里,我把代码贴出来,纪念一下我"逝去"的代码~ (function() { var i18n = { lang: 'en_US', phrases: {}, tr: function (word) { return i18n.phrases[i18n.lang][word]; }, setLang: function(lang = 'en_US') { status: ${xhr.status}`); } var phrases = JSON.parse(xhr.responseText); i18n.phrases = phrases;

    37530编辑于 2023-10-20
  • 来自专栏Reck Zhang

    ACMSGURU 404 - Fortune-telling with camomile

    Such phrases like “loves”, “doesn’t love”, “loves sincerely”, “doubts”, “wants to date”, “laughs” are Phrases are pronounced from the first to the last. The list of phrases is cyclic, so after the last phrase you should pronounce the first one. two integer numbers N and M (1 <= N <= 100, 1 <= M <= 100), the number of petals and the number of phrases Phrases consist only of latin letters and their lengths are between 1 and 100.

    31520发布于 2021-08-11
  • 来自专栏字根中文校对软件

    双文对比,在线纯文本文档差异比较 API 接口

    ins_phrases_arr 数组:增加内容的数组,每个元素包含三个字段:hash_tag,content,pos。 del_phrases_arr 数组:删除内容的数组,每个元素包含三个字段:hash_tag,content,pos。 total_cn_num":0, "total_non_cn_num":0, "ins_char_num":0, "del_char_num":0, "ins_count":0, "del_count":0, "ins_phrases_arr ":[{"hash_tag":"ht_ins_1","content":"2","pos":0}], "del_phrases_arr":[{"hash_tag":"ht_del_0","content

    79520编辑于 2023-10-16
  • 来自专栏机器学习AI算法工程

    Keyphrase Extraction 一个快速从中文里抽取关键短语的工具

    例如:For example: >>> phrases = ['俄罗斯克里姆林宫', '邀请金正恩访俄', '最高司令官金正恩', '朝方转交普京', '举行会谈'] 2 key_phrases = ckpe_obj.extract_keyphrase(text) print(key_phrases) print(ckpe_obj.extract_keyphrase. .' >>> key_phrases = jio.keyphrase.extract_keyphrase(text) >>> print(key_phrases) >>> print(jio.keyphrase.extract_keyphrase word_dict = {'局': 1, '国务院': 1, '检察院': 1, '法院': 1} key_phrases = ckpe_obj.extract_keyphrase(text, top_k =-1, specified_words=word_dict, remove_phrases_list=['麻将局']

    3.3K10编辑于 2022-03-17
  • 来自专栏算法微时光

    pythoin pypinyin汉字转拼音库使用

    支持 ‘default’, ‘tone2’ load_phrases_dict pypinyin.load_phrases_dict(phrases_dict, style='default') 载入用户自定义的词语拼音库 参数 说明 phrases_dict (dict) 词语拼音库。 比如: {u"阿爸": [[u"ā"], [u"bà"]]} style phrases_dict 参数值的拼音库风格.

    3.1K10发布于 2020-04-23
  • 来自专栏四火的唠叨

    Grails 引发的中文乱码问题

    支持正则表达式: <filter> <words> <word>fuck</word> <word>kill</word> </words> <phrases > <phrase>asshole</phrase> </phrases> <grammars> <grammar>kick. substitution=node.substitution.text() def sensitive=[node.words.word*.text().join('|'), node.phrases.phrase

    97620编辑于 2022-07-15
  • 文本摘要系统开发全记录:从理论到实践的技术探索日志

    __init__() def _extract_key_phrases(self, text, topK=10): """ 提取关键短语 (self, key_phrases): """ 基于关键短语生成摘要句子 Args: key_phrases (list _extract_key_phrases(text, topK=8) # 提取关键句子 key_sentences = self. _generate_summary_from_phrases(key_phrases) summary_parts.append(phrase_summary) _generate_summary_from_phrases(key_phrases)实现要点:利用TF-IDF提取文本中的关键词通过关键词密度选择重要句子结合关键词和关键句子生成新的摘要内容控制摘要长度以满足用户需求这种方法的优点是摘要更加流畅自然

    27410编辑于 2025-09-27
  • 来自专栏拓端tecdat

    python主题建模可视化LDA和T-SNE交互式可视化

    In [5]: from gensim.models import Phrases# 向文档中添加双字母组和三字母组(仅出现10次或以上的文档)。 bigram = Phrases(docs, min_count=10)trigram = Phrases(bigram[docs]) for idx in range(len(docs)):for token /opt/conda/lib/python3.6/site-packages/gensim/models/phrases.py:316: UserWarning: For a faster implementation , use the gensim.models.phrases.Phraser classwarnings.warn("For a faster implementation, use the gensim.models.phrases.Phraser

    1.5K10发布于 2021-01-13
  • 来自专栏NLP小白的学习历程

    文本处理工具 - TextBlob

    ', 'JJ'), ('programming', 'NN'), ('language', 'NN')] Noun Phrase Extraction(名词短语列表) Similarly, noun phrases are accessed through the noun_phrases property. 注意:只提取名词短语 >>> wiki.noun_phrases WordList(['python']) Sentiment Analysis(情感分析) 返回一个元组 Sentiment(polarity . >>> wiki.noun_phrases.count('python') #短语频次 1 Translation and Language Detection(翻译及语言检测语言) New in blob.noun_phrases # WordList(['titular threat', 'blob', # 'ultimate

    3.4K21发布于 2020-11-12
  • 来自专栏四楼没电梯

    50行代码完成任何RAG chunking 惊讶程度10% 50行代码的正则表达式 惊讶程度100%

    Citations // List items // Block quotes // Code blocks // Tables // Horizontal rules // Standalone lines or phrases // Sentences or phrases // Quoted text, parenthetical phrases, or bracketed content // Paragraphs // Standalone lines or phrases (including single-line blocks and HTML elements, with length constraints) Sentences or phrases ending with punctuation (including ellipsis and Unicode punctuation) `(?:(? Quoted text, parenthetical phrases, or bracketed content (with length constraints) "(?

    24110编辑于 2024-10-12
  • 来自专栏机器学习、深度学习

    语义分割

    . + object’ leads to 20×21×20 = 8400 然后对其进行过滤,得到 hundreds of meaningful phrases,用这些语言描述去搜索图像,根据图像数量再过滤一下 最终得到 59 valid phrases IDW has 41,421 images and descriptions ?

    60140发布于 2019-05-26
  • 来自专栏拓端tecdat

    python主题建模可视化LDA和T-SNE交互式可视化|附代码数据

    In [5]:from gensim.models import Phrases# 向文档中添加双字母组和三字母组(仅出现10次或以上的文档)。 bigram = Phrases(docs, min_count=10)trigram = Phrases(bigram\[docs\])for idx in range(len(docs)):     /opt/conda/lib/python3.6/site-packages/gensim/models/phrases.py:316: UserWarning: For a faster implementation , use the gensim.models.phrases.Phraser class  warnings.warn("For a faster implementation, use the gensim.models.phrases.Phraser

    90940编辑于 2023-07-25
  • 来自专栏快学Python

    带你玩儿转 “中国汉字”,实力不够,Python来凑!

    这里可以使用load_phrases_dict 方法。 from pypinyin import lazy_pinyin, load_phrases_dict personalized_dict = {'黄同学': [['huáng'], ['tòng' ], ['xué']]} load_phrases_dict(personalized_dict) lazy_pinyin("黄同学",style=Style.TONE) 结果如下: ?

    1K20发布于 2021-08-09
  • 来自专栏云云众生s

    Chroma 初探:面向 LLM 的开源向量数据库

    phrases = [ "Amanda baked cookies and will bring Jerry some tomorrow. collection.add( documents=phrases, metadatas=metadatas, ids=ids ) 我们可以快速检查插入的文档是否生成了嵌入。 import chromadb phrases = [ "Amanda baked cookies and will bring Jerry some tomorrow. collection = chroma_client.get_or_create_collection(name="tns_tutorial") collection.add( documents=phrases

    2.2K10编辑于 2024-03-27
  • 来自专栏云上修行

    深入解析 MeloTTS:中文 TTS Pipeline 与多音字修正实战

    实施步骤: 在 MeloTTS/melo/text/chinese_mix.py 或初始化代码中注入: from pypinyin import load_phrases_dict # 定义修正词典 custom_phrases = { '重载': [['chóng'], ['zài']], # 覆盖默认为 zhòng zài 的错误 '行长': [['háng'], ['zhǎng ']], '都': [['dū']], # 强制特定单字读音(慎用) } # 加载词典 load_phrases_dict(custom_phrases) 优点: 无需修改核心代码架构。

    18310编辑于 2026-02-14
  • 来自专栏FreeSWITCH中文社区

    使用Voicemail实例

    say-module="zh" sound-prefix="$${sounds_dir}/zh/cn/link" tts-engine="cepstral" tts-voice="callie"> <phrases -- IVR and custom phrases go here --> </macros> <X-PRE-PROCESS cmd="include" data="vm/voicemail_ivr.xml "/> </phrases> </language> </include> 到这里用到的Voicemail部分就结束了。

    1.6K20发布于 2020-12-21
  • 来自专栏生信宝典

    这篇文献总结了常见的中式英语写法,来看看有没有中枪?

    Tendency of placing phrases which indicate time at the beginning of a sentence When U is taken as the In this paper, in this study Two errors occur when these phrases are used. The first is overuse. In some papers written by Chinese, these phrases can occur as much as twice per page. In papers written by native English writers these phrases are reserved for primarily two uses In the The two phrases are interchanged. In this paper, IDEAS was used to ….

    97810编辑于 2022-01-19
  • 来自专栏一“技”之长

    为你的应用程序增加AppIntent能力

    appShortcuts: [AppShortcut] { AppShortcut( intent: CoffeeIntent(), phrases systemImageName: "magnifyingglass" ) AppShortcut( intent: CoffeeIntent(), phrases "square.and.pencil" ) AppShortcut( intent: CoffeeIntent(), phrases

    1.5K10编辑于 2024-05-29
领券