• NLP工具再汇总


    本文主要是针对specific domain中的KG构建中涉及到的相关工具完成梳理、配置、简单使用工作,达到熟悉的目的。

    涉及知识点

    短语挖掘——在关键词提取和属性提取等IE抽取中,作用还是蛮大的,可以用做校准的依据。
    知识分类体系建设
    NLP工具(一般一个工具,具有多种功能,比如分词、分句、句法依存分析、NER等等)——样例地址:project_hj_py

    1. Stanford CoreNLP
    2. spaCy——spaCy中可以添加pattern。类似于re,但如果熟练re的话,可以直接用re。
    3. NLTK——包含了stopwords文件,本机存放地址为C:\Users\ASUS\AppData\Roaming\nltk_data\corpora\stopwords

    KG 工具

    1. Cayley
    2. Neo4j

    网页信息抽取
    Domain PLM训练

    停用词删除

    from nltk.tokenize import word_tokenize
    from nltk.corpus import stopwords
    def Delete_stopwords(example_sent):
        stop_words = set(stopwords.words('english'))
    
        word_tokens = word_tokenize(example_sent)
    
        filtered_sentence = [w for w in word_tokens if not w in stop_words]
    
        filtered_sentence = []
    
        for w in word_tokens:
            if w not in stop_words:
                filtered_sentence.append(w)
    
        return word_tokens,filtered_sentence
    
    example_sent = "This is a sample sentence, showing off the stop words filtration."
    word_tokens,filtered_sentence=Delete_stopwords(example_sent)
    print(word_tokens,filtered_sentence)
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21

    停用词文件:

    https://www.nltk.org/nltk_data/——73项

    网页信息抽取:

    不仅只有re表达式的方式,在大量网站抽取时,好像是有专门的研究分支——网页信息抽取技术。
    
    • 1

    Google Sheet:https://cn.gijn.org/2022/07/22/data-extraction-tools/
    可以捕获标签内的text内容。通过公式,IMPORTXML导入网页元素。
    Google sheet教程:https://blog.coupler.io/importhtml-function-google-sheets/
    建议:如果会爬虫,就不要用Google sheet,不好使,还没现有的爬虫软件好用。

  • 相关阅读:
    fiddler的使用
    连锁药店的自有品牌之争:老百姓大药房能否突围?
    【Java 基础】Java 反射使用方法简介
    Transformer 01(自注意机制Self-attention)
    我的前端开发技巧
    宝塔面板建站
    「C++」深度分析C++中i++与++i的区别
    打印机 默认使用 首选项配置
    系分 - 项目管理
    木棍加工时间优化,代码精简
  • 原文地址:https://blog.csdn.net/Hekena/article/details/126136641