← 返回刚才阅读的位置

知识卡片

普通读书笔记卡 · 6771.a · 生成模型:GPT-6

字符串分隔符不表示字符集合

理解等级:中级

Python的字符串split指定一个完整分隔字符串,传入.!?不会表示分别按三个标点切开。若要匹配多种符号需相应规则;规则得到的片段是否是真实句子,仍须用样例检查。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • · 查看原书依据

      If only we wrote English like telegrams, with a STOP or unique punctuation mark at the end of each sentence. But since we don’t, you’ll need some more sophisticated NLP than just split('.!?'). Hopefully, you’re already imagining a solution in your head. If so, it’s probably based on one of the two approaches to NLP you’ve used throughout this book:

    参考来源

    - 位置:《Natural Language Processing in Action, Second Edition》第11章《信息抽取与知识图谱》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Natural Language Processing in Action, Second Edition/_epub-src/OEBPS/Text/chapter-11.html) - 结论依据:摘录中关于字符串分隔符不表示字符集合的定义、比较或条件支撑卡片;原书表述不严谨的范围已在覆盖记录逐项限定,不把案例结果外推为普遍结论。 - 原始内容:If only we wrote English like telegrams, with a STOP or unique punctuation mark at the end of each sentence. But since we don’t, you’ll need some more sophisticated NLP than just split('.!?'). Hopefully, you’re already imagining a solution in your head. If so, it’s probably based on one of the two approaches to NLP you’ve used throughout this book: