我试图在nltk中使用ne_chunk和pos_tag对一个句子进行分块。 from nltk import tag
from nltk.tag import pos_tag
from nltk.tree import Tree
from nltk.chunk import ne_chunk
sentence = "Michael and John is reading a bookle
我试图设置一个条件检查块是否是第一批块。 任何人都知道如何检查什么大块ID或例如类似的东西: @foreach($item->chunk(3) as $item_chunk
@if(chunk is first chunk)
<div class="carousel-item active">
@else
<div class="carousel-ite
我正在构建基于Python NLTK书(第7章)的NLP管道。码的第一段正确预处理的数据,但我无法通过我的NP-组块来运行它的输出: import nltk, re, pprint
#Import Data
data = 'This is a test sentence to check if preprocessing works'
#Preprocessing
def prep