写作网站5秒不写就删除/网络推广项目代理

写作网站5秒不写就删除,网络推广项目代理,做阿里巴巴网站电话,樟木头做网站NLP 清晰版本查看 Sentence segmentation (split)Tokenisation (split)Named entity recognition (combine) 概念主要內容典型方法Distributional Semantics(分佈式語義)(分銷語義(分佈式語義)單詞的語義來自於它的…

NLP

清晰版本查看

  • Sentence segmentation (split)
  • Tokenisation (split)
  • Named entity recognition (combine)
概念主要內容典型方法
Distributional Semantics(分佈式語義)(分銷語義(分佈式語義)單詞的語義來自於它的上下文共現矩陣(Co-occurrence Matrix),PMI共現矩陣(共發生矩陣Chesi
Word Embeddings(詞嵌入)變成嵌入(詞嵌入)將單詞映射到低維向量空間,以捕捉語義關係Word2Vec、GloVe、FastText、BERTword2vec,手套,fasttx,bere
Word Sense Disambiguation(詞義消歧)單詞感官歧義(詞義消歧)根據語境確定詞的正確含義WordNet、機器學習、BERT

introduction to NLP

A research field focussed on creating software systems with knowledge about natural (human) language 研究重點是關於自認語言的知識

Interdisciplinary: makes use of theories from Linguistics 語言學理論, adopts an Engineering approach

Aimed at human-like understanding of language (but not yet there)

[!tip] Contributing disciplines
Linguistics: formal models of language, linguistic knowledge
Computer Science: representations, efficient processing, state machines, parsing
algorithms, probabilistic models, dynamic programming, machine learning
Mathematics: formal automata theory, computational modelling
Psychology: psychologically plausible modelling of language use

Many types of ambiguity歧義:

  • Phonological 語音學
    • multiple interpretations due to how it sounds 有些音聽起來一樣 那麼在識別的時候會存在很多種解釋
  • Lexical 詞匯
    • multiple interpretations due to a word having multiple senses 詞語的歧義,由於有的單詞本身帶有的意思多重導致的
  • Syntactic 句法
    • due to a word having more than one possible part of speech 一個單詞有多個演講部分
    • due to prepositional phrase attachment 介詞的附件
  • Semantic 語義
    • multiple possible interpretations解釋 unless knowledge of the world is available

[!danger] Two major approaches to NLP

  • Symbolic 象征
    • Rule- and dictionary-based systems 基於規則和字典系統
    • Captures linguistic knowledge in rules written by experts 補貨專家撰寫的規則中的語言知識
  • Statistical/Machine learning-based
    • Data-driven 數據驅動
    • Use of large amounts of (labelled) textual data (文本數據) to train systems, discover patterns

Comparison

SymbolicStatistical/Machine learning
✅  Expert knowledge yields highly precise results 專業知識會產生高度精確的結果✅Can generalise well on unseen examples可以很好的概括在看不見的例子上
Shortage of experts❎Need people for labelling
❎Laborious rule writing, dictionary preparation❎Time consuming and laborious labelling 耗時且費力
❎ Domain adaptation problematic域適應性問題❎Must retrain for new domain必須重新訓練
✅Results can be interpreted結果可以解釋❎ Often cannot inspect/change models通常無法檢查/更改模型
✅  Good when labelled data is hard to obtain當很難獲得標記的數據時✅ Good where dictionaries are unavailable

NLP Pipelines

A ‘complete’ NLP system is usually a pipeline of components

在这里插入图片描述

  • Sentence Segmentation 句子細分
  • Tokenisation 象征化
  • Parsing
  • Information

在这里插入图片描述


  • Sentence segmentation (split)
  • Tokenisation (split)
  • Named entity recognition (combine)

Why is NLP challenging:

  • Natural Language evolve:
    • new words appear constantly
    • Syntactic rules are flexible 句法規則靈活
    • ambiguity (模糊性) is inherent 固有的

Why Machine Learning for NLP

  • Traditional rule-based artificial intelligence (symbolic AI):
    • requires expert knowledge to engineer the rules 需要專家知識來設計
    • not flexible to adapt in multiple languages, domains, applications 不能靈活低使用與多種語言
  • Learning from data (machine learning) adapts:
    • to evolution: just learn from new data 從新數據中學習
    • to different applications: just learn with the appropriate target representation

Sentence Segmentation 句子細分

Sentence Detection is done before the text is tokenized 句子檢測在文本標記化之前進行

Task 順序:

  • Determination of boundaries between sentences確定句子之間的界限
  • Sentences used in subsequent NLP tasks 隨後NLP中使用的句子
  • Is it enough to detect the full stop
    • Could be an end-of-sentence (EOS) marker 可能是句子結束 (EOS) 標記
    • Or an end of abbreviation marker 縮寫標記的結尾
    • Or both

通常是Text Mining的第一步,因為它將非結構化文本拆分成基本處理單位

Variation in delimiters

  • Typical:“.”,“!”,“?”

[!todo] # Approaches

  • Regular expressions (Patterns) 正則表達式
  • Dictionaries (e.g., abbreviation lists) 字典
  • Hand-crafted rules 手工製作的規則(e.g., to check whether the word following an EOS delimiter starts with an uppercase character 檢查EOS界定符之後的單詞是否從大寫字符開始)
  • Statistical and ML approaches
  • Hybrid approaches 混合方法

Example of useful rules or Features

First character after potential EOS char 潛在EOS Char之後的第一個字符
● Should be uppercase? Problematic for some languages, e.g. German
● Permissible chars after potential EOS, e.g. lowercase characters?
Abbreviations 縮寫
● titles not likely to occur at EOS (e.g., Dr. Jones)
● company indicators could occur at EOS (e.g., MySocialMedia Inc.)

OpenNLP

The OpenNLP Sentence Detector cannot identify sentence boundaries based on the contents of the sentence 無法根據內容識別句子邊界

OpenNLP 開發文檔

輸出的是一個個string 每個string都是一個分解出來的句子

spaCy

for pdf and word docs

spaCy 開發文檔

Tokenisation 象征化

Why need Tokenisation

  • 機器學習模型通常使用「單詞」作為特徵,例如詞頻統計、情感分析等。
  • 英文單詞之間有空格,中文沒有,需要不同的處理方法。

Break sentence into tokens

3 main classes of tokens often considered

  • Morphosyntactic word
  • Punctuation mark or special symbol
  • A number
  • Endings of contractions, e.g., “'re” in “we’re”
  • Compounds and multi-words (e.g., daughter-in-law)

Challenges:

  • Character encoding
    • ASCII only?
    • Unicode (UTF-8)
  • ASCII-fication or romanisation of texts
    • Transliterations
  • Results from OCR may be poor
    • Pre-processing to detect/correct errors 預處理
    • OCR errors may appear as correct text (but not intended text)

[!attention] Challenging

  • Hyphenation
    • Manchester-based
    • Sister-in-law
  • Telephone numbers: many different Formats
    • with whitespace, dots
    • slashes, hyphens, parentheses, plus signs

[!example]+

  • Dates: 04 January 2018; 04-01-2018, Jan 4, 2018
  • Decimals: 0.05; 3.4; .6
  • Monetary values: a £5-a-dish dinner

Split or not to split

  • Sentence segmentation (split)
  • Tokenisation (split)
  • Named entity recognition (combine)
    In other words: tokenisation is knowing when to split (not when to combine)

Annotation Formats

Annotation(標註) 是在文本中為每個 token 添加額外的信息,例如詞性標註Part-of-Speech Tagging, POS Tagging)、命名實體識別Named Entity Recognition, NER)等。

Understanding documents

Documents rarely have a simple structure 很少有簡單結構
Documents are meant to be human-readable

[!example]

  • news article
  • research article

Annotations:

Enabling machine-readablility

在这里插入图片描述

在这里插入图片描述
如圖展示的 他從單純的文字變成機器可讀的樣式

Types of annotation Formats

Boundary notation 邊界符號
Inline markup language elements 內聯標記語言元素
Stand-off

  • delimiter-separated values (DSV)
  • JSON

Part-od-Speech Tagging (POS Tagging) 詞性標註

給每個單詞分配詞性標籤

[!example]

import nltk 
nltk.download('averaged_perceptron_tagger') 
sentence = "She runs fast." 
tokens = word_tokenize(sentence) 
pos_tags = nltk.pos_tag(tokens) 
print(pos_tags) 
# [('She', 'PRP'), ('runs', 'VBZ'), ('fast', 'RB')]

Named Entity Recpgnition (NER) 命名實體識別

NER 用來識別文本中的人名、地名、組織名等專有名詞

句子:
“Apple is looking at buying U.K. startup for $1 billion.”

NER 標註結果:

  1. “Apple” → ORG(組織)
  2. “U.K.” → GPE(地名)
  3. “$1 billion” → MONEY(貨幣)
import spacy 
nlp = spacy.load("en_core_web_sm") 
sentence = "Apple is looking at buying U.K. startup for $1 billion." 
doc = nlp(sentence) for ent in doc.ents: print(ent.text, ent.label_) 
# Apple ORG 
# U.K. GPE# $1 billion MONEY

Boundary Notation

Done at the level of individual tokens 在單個token完成
How do we encode units of interest spanning several tokens
BIO: B=Begin I=Inside O=Outside

[!example]
在这里插入图片描述

  • Strengths
    • simple
  • limitations
    • cannot handle hierarchical or structured annotations e.g., nested entities(NES) 嵌套實體, relations events

[!example] Nested entities

在这里插入图片描述

展示了Named Entity Recognition (NER) 命名實體識別的結果

  • 是一種NLP技術,用來識別文本中的關鍵實體,比如地名 (GPE)組織 (Org), 人物 (Person)事件 (Conflict_Attack)
  • GPE:
    • 國家或地區名稱
  • Org:
    • 機構或組織的名稱
  • Person:
    • 具體人名
  • Contact_Meet:
    • 這類標籤標識涉及會議或高級別會議
  • Conflict_Attack(衝突/攻擊, Conflict_Attack
    • 標識與戰爭或攻擊有關的事件
  • 關係標註(箭頭)
    • 表示某人參與了一場活動
    • Target (目標)
    • 標識某個實體是某個行動的目標

Inline markup language elements

By addition of markup tags within text

  • HTML
  • XML

[!example]
在这里插入图片描述

Strengths:

  • can handle annotations which are hierarchical (e.g., nested NEs, trees) and structured (e.g., events) 可以處理分層的注釋
    Limitations:
  • requires substantial processing with standard XML parsers 對標準XML處理器進行大量處理
  • impossible to encode overlapping/intersecting annotations, e.g., second Iraqi city of Basra 無法編碼重疊/相交注釋

Stand-off Annotations (JSON格式)

將標註信息與原始文本分離的標註方式,而不是將標註直接嵌入到文本內部。

為什麼使用 Stand-off Annotation?

  1. 避免污染原始數據:原始文本保持不變,標註信息存儲在外部文件或數據結構中。
  2. 允許多層次標註:可以為相同文本提供多種標註(如詞性、語法結構、命名實體等),並獨立管理它們。
  3. 便於版本控制:標註數據和原始文本分開存儲,有助於管理不同版本的標註信息。
  4. 支持長文本處理:對於超大文本,標註信息存儲在索引數據結構中,提高效率。

[!example]+

UK and US discuss the role of UN.

stand-off 標註文件

{"text": "UK and US discuss the role of UN.","annotations": [{"id": "T1","type": "GPE","start": 0,"end": 2,"text": "UK"},{"id": "T2","type": "GPE","start": 7,"end": 9,"text": "US"},{"id": "T3","type": "ORG","start": 27,"end": 29,"text": "UN"}]
}

annotations are stored separately
requires a way to link between annotations and text
links annotations to text using indexing based on character offsets (computed over raw
text)

  • strength:
    • original raw text is left untouched 原始文本未觸及
    • can handle structured and overlapping annotations 可以處理結構化和重疊的注釋
  • limitations:
    • not readily human-readable

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/web/70040.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Linux中线程创建,线程退出,线程接合

线程的简单了解 之前我们了解过 task_struct 是用于描述进程的核心数据结构。它包含了一个进程的所有重要信息,并且在进程的生命周期内保持更新。我们想要获取进程相关信息往往从这里得到。 在Linux中,线程的实现方式与进程类似,每个线程都…

HarmonyOS:使用List实现分组列表(包含粘性标题)

一、支持分组列表 在列表中支持数据的分组展示,可以使列表显示结构清晰,查找方便,从而提高使用效率。分组列表在实际应用中十分常见,如下图所示联系人列表。 联系人分组列表 在List组件中使用ListItemGroup对项目进行分组&#…

django上传文件

1、settings.py配置 # 静态文件配置 STATIC_URL /static/ STATICFILES_DIRS [BASE_DIR /static, ]上传文件 # 定义一个视图函数,该函数接收一个 request 参数 from django.shortcuts import render # 必备引入 import json from django.views.decorators.http i…

Office word打开加载比较慢处理方法

1.添加safe参数 ,找到word启动项,右击word,选择属性 , 添加/safe , 应用并确定 2.取消加载项,点击文件,点击选项 ,点击加载项,点击转到,取消所有勾选,确定。

内网下,Ubuntu (24.10) 离线安装docker最新版教程

一般在数据比较敏感的情况下,是无法使用网络的,而对于Ubuntu系统来说,怎么离线安装docker呢? 下面我给大家来讲一下: 采用二进制安装: 1.下载docker离线包 官网下载: Index of linux/static…

Copilot Next Edit Suggestions(预览版)

作者:Brigit Murtaugh,Burke Holland 排版:Alan Wang 我们很高兴向你介绍在本次 Visual Studio Code 发布中,关于 GitHub Copilot 的三个预览功能: Next Edit Suggestions(NES)Copilot Edits 的…

高性能内存对象缓存Memcached详细实验操作

目录 前提准备: cache1,2: 客户端cache-api(一定得是LAMP环境) memcache实现主主复制以及高可用(基于以上完成) cache1,2: memcachekeepalived(基于以上完成) cache1,2: 前提准备: 1. 准备三台cent…

Spring AI发布!让Java紧跟AI赛道!

1. 序言 在当今技术发展的背景下,人工智能(AI)已经成为各行各业中不可忽视的重要技术。无论是在互联网公司,还是传统行业,AI技术的应用都在大幅提升效率、降低成本、推动创新。从智能客服到个性化推荐,从语…

UART(一)——UART基础

一、定义 UART(Universal Asynchronous Receiver/Transmitter)是一种广泛使用的串行通信协议,用于在设备间通过异步方式传输数据。它无需共享时钟信号,而是依赖双方预先约定的参数(如波特率)完成通信。 功能和特点 基本的 UART 系统只需三个信号即可提供稳健的中速全双工…

【PHP】php+mysql 活动信息管理系统(源码+论文+数据库+数据库文件)【独一无二】

👉博__主👈:米码收割机 👉技__能👈:C/Python语言 👉专__注👈:专注主流机器人、人工智能等相关领域的开发、测试技术。 【PHP】php 活动信息管理系统(源码论文…

数据结构——单向循环链表、双链表、双向循环链表

目录 一、单向循环链表 1.1 单向循环链表的概念 1.2 单向循环链表的操作 1.2.1 单向循环链表的创建 1.2.2 单向循环链表的头插 1.2.3 单向循环链表的遍历 1.2.4 单向循环链表的头删 1.2.5 单向循环链表的尾插 1.2.6 单向循环链表的尾删 1.2.7 约瑟夫环 1.3 单向循环列表所有程…

wordpress资讯类网站整站打包

wordpress程序,内置了价值499元的模板.但是有了模板没有全自动采集相信大多数人都搞不懂,目录那么多,全靠原创几乎是不可能的事情,除非你是大公司,每人控制一个板块, 这套源码里面最有价值的应该是这个采集…

使用verilog 实现 cordic 算法 ----- 旋转模式

1-设计流程 ● 了解cordic 算法原理,公式,模式,伸缩因子,旋转方向等,推荐以下链接视频了解 cordic 算法。哔哩哔哩-cordic算法原理讲解 ● 用matlab 或者 c 实现一遍算法 ● 在FPGA中用 verilog 实现,注意…

教育小程序+AI出题:如何通过自然语言处理技术提升题目质量

随着教育科技的飞速发展,教育小程序已经成为学生与教师之间互动的重要平台之一。与此同时,人工智能(AI)和自然语言处理(NLP)技术的应用正在不断推动教育内容的智能化。特别是在AI出题系统中,如何…

VScode内接入deepseek包过程(本地部署版包会)

目录 1. 首先得有vscode软件 2. 在我们的电脑本地已经部署了ollama,我将以qwen作为实验例子 3. 在vscode上的扩展商店下载continue 4. 下载完成后,依次点击添加模型 5. 在这里可以添加,各种各样的模型,选择我们的ollama 6. 选…

作用域链精讲

作用域链精讲 1编译阶段1.1分词1.2解析(解析为抽象语法树AST)1.3代码生成 2执行阶段3查询阶段4嵌套机制(这个比较重要)----就近原则5异常5.1计算机为啥要区分LHS和RHS5.2RHS查询5.3LHS查询 6什么是词法作用域7遮蔽效应8变量和函数的声明提升(也是预解析)…

Arduino-ESP8266 GPIO(中断或轮询)

检测GPIO高低电平 1. 中断 2. 轮询 gpio.ino // GPIO按键输入 // 监听高电平接线图 // ESP8266 NodeMCU // ┌───────────┐ // │ D1(GPIO5) │──────┤按键一端 // │ │ │ // │ 3V3 │──────┤按键另一端 // └───…

FPGA简介|结构、组成和应用

Field Programmable Gate Arrays(FPGA,现场可编程逻辑门阵列),是在PAL、GAL、CPLD等可编程器件的基础上进一步发展的产物, 是作为专用集成电路(ASIC)领域中的一种半定制电路而出现的&#xff0c…

WPF的MVVMLight框架

在NuGet中引入该库&#xff1a; MVVMLight框架中的命令模式的使用&#xff1a; <StackPanel><TextBox Text"{Binding Name}"/><TextBox Text"{Binding Title}"/><Button Content"点我" Command"{Binding ShowCommand…

地平线征程6全球首发上车比亚迪,开启大规模量产交付

2月10日&#xff0c;比亚迪举办智能化战略发布会&#xff0c;对外正式公布全民智驾战略&#xff0c;并发布全新天神之眼高阶智驾系统。未来&#xff0c;比亚迪全系车型将搭载天神之眼高阶智驾系统。 值得注意的是&#xff0c;地平线最新一代车载智能计算方案征程6系列全球首发…