Chunking sentences using the word 'but' with RegEx
问题 I am attempting to chunk sentences using RegEx at the word 'but' (or any other coordinating conjunction words). It's not working... sentence = nltk.pos_tag(word_tokenize("There are no large collections present but there is spinal canal stenosis.")) result = nltk.RegexpParser(grammar).parse(sentence) DigDug = nltk.RegexpParser(r'CHUNK: {.*<CC>.*}') for subtree in DigDug.parse(sentence).subtrees(): if subtree.label() == 'CHUNK': print(subtree.node()) I need to split the sentence "There are no