Webページから固有表現を抽出
Webページからの固有表現抽出を試みます. CoreNLPのOpenIEアノテータ, POSアノテータによる抽出を試みます. 事前にCoreNLPサーバをdockerで展開済みです.
In [1]:
import pandas as pd
import numpy as np
import nltk
import urllib.parse
import urllib.request
from lxml import html
import requests
import json
from collections import OrderedDict
import re
import queue
import collections
from joblib import load, dump
from IPython.display import clear_output
from graphviz import Digraph
import nltk
In [2]:
url = "https://en.wikipedia.org/wiki/Lobes_of_the_brain"
body = requests.get(url).text
tree = html.fromstring(body).cssselect('body')[0]
前処理¶
In [3]:
step0 = re.sub(r'[\n\t(\xa0)]', ' ', tree.text_content())
step1 = re.sub(r'{.*}', '', step0)
step1
Out[3]:
' Lobes of the brain From Wikipedia, the free encyclopedia Jump to navigation Jump to search Parts of the cerebrum This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: "Lobes of the brain" – news · newspapers · books · scholar · JSTOR February 2013 Learn how and when to remove this template message Cerebral lobesLateral surface of cerebrum. 4 lobes are shown.Medial surface of cerebrum. 5 lobes are shown.IdentifiersNeuroNames1210NeuroLex IDbirnlex_922TA98A14.1.09.005TA25431FMA77800Anatomical terms of neuroanatomy[edit on Wikidata] The lobes of the brain were originally a purely anatomical classification, but have been shown also to be related to different brain functions. The cerebrum, the largest portion of the human brain, is divided into lobes, but so is the cerebellum. If not specified, the expression "lobes of the brain" refers to the cerebrum. Terminologia Anatomica 1998 and Terminologia Neuroanatomica 2017 divides the cerebrum into 6 lobes.[1][2] Each lobe of the brain consists of different sub regions that work together to create full function within the entirety of the brain. Contents 1 Frontal lobe 2 Parietal lobe 3 Occipital lobe 4 Temporal lobe 5 Limbic lobe 6 Insular cortex 7 Additional images 8 See also 9 References 10 External links Frontal lobe[edit] Main article: Frontal lobe The frontal lobe is located at the front of each cerebral hemisphere and positioned in front of the parietal lobe and above and in front of the temporal lobe.It was first discovered by Sir Niks Dhangar. It is separated from the parietal lobe by a space between tissues called the central sulcus, and from the temporal lobe by a deep fold called the lateral sulcus also called the Sylvian fissure. The precentral gyrus, forming the posterior border of the frontal lobe, contains the primary motor cortex, which controls voluntary movements of specific body parts.Precentral region contains Primary motor cortex area 4 and Premotor cortex area 6 .These areas control movements,both skilled and postural The frontal lobe contains most of the dopamine-delicate neurons in the cerebral cortex. The dopamine system is associated with reward, attention, short-term memory tasks, planning, and motivation. Dopamine tends to limit and select sensory information arriving from the thalamus to the forebrain[citation needed]. A report from the National Institute of Mental Health says a gene variant that reduces dopamine activity in the prefrontal cortex is related to poorer performance and inefficient functioning of that brain region during working memory tasks, and to a slightly increased risk for schizophrenia.[3] The frontal lobe consists of the prefrontal cortex which is located in the most anterior farthest away section of the frontal lobe. It is critical for one’s working memory and executive control which helps keep goals and complex tasks organized. The divisions of the prefrontal cortex include orbital, medial, and lateral prefrontal cortex. Within the lateral prefrontal cortex there are two different divisions: the dorsolateral and ventrolateral prefrontal cortex. The dorsolateral prefrontal cortex is located on top of the ventrolateral prefrontal cortex and is mainly responsible for the executive control and manipulation of memories that are retrieved through episodic memory. The ventrolateral prefrontal cortex is important for the regulation of meaningful stimuli that a person experiences throughout their lifetime, such as images, letters, and names. Damage to the prefrontal cortex can result in issues with one’s long term and short-term memories, as well as create changes in people’s behaviors and their abilities to plan and organize Gluck, Mercado, & Myers, 2020 . Damage can result from lesions or tumors that have been surgically removed, and traumatic brain injuries TBI experienced from a severe hit to the head causing damage to the brain from swelling. Most often a TBI is experienced within a person’s childhood from playing competitive sports or an accident from normal play. Having a traumatic brain injury can increase your chances of developing neurological psychiatric problems and abusing substances, such as cannabis, is known to be a risk factor in developing symptoms associated with schizophrenia Jain, & Srivastava, 2017 . Jain, & Srivastava, 2017 found that the schizophrenia symptoms hearing voices, talking to people who were not there, etc. worsened after the usage of cannabis, suggesting that a TBI from childhood can enhance a development of psychosis due to the changes seen in the white matter within the frontal-temporal areas. Parietal lobe[edit] Main article: Parietal lobe The parietal lobe is positioned above the occipital lobe and behind the frontal lobe and central sulcus. The parietal lobe integrates sensory information among various modalities, including spatial sense and navigation proprioception , the main sensory receptive area for the sense of touch mechanoreception in the somatosensory cortex which is just posterior to the central sulcus in the postcentral gyrus,[4] and the dorsal stream of the visual system. The major sensory inputs from the skin touch, temperature, and pain receptors , relay through the thalamus to the parietal lobe. Several areas of the parietal lobe are important in language processing. The somatosensory cortex can be illustrated as a distorted figure — the homunculus Latin: "little man" , in which the body parts are rendered according to how much of the somatosensory cortex is devoted to them.[5] The superior parietal lobule and inferior parietal lobule are the primary areas of body or spatial awareness. A lesion commonly in the right superior or inferior parietal lobule leads to hemineglect. Occipital lobe[edit] Main article: Occipital lobe The occipital lobe is the visual processing center of the mammalian brain containing most of the anatomical region of the visual cortex.[6] The primary visual cortex is Brodmann area 17, commonly called V1 visual one . Human V1 is located on the medial side of the occipital lobe within the calcarine sulcus; the full extent of V1 often continues onto the posterior pole of the occipital lobe. V1 is often also called striate cortex because it can be identified by a large stripe of myelin, the Stria of Gennari. Visually driven regions outside V1 are called extrastriate cortex. There are many extrastriate regions, and these are specialized for different visual tasks, such as visuospatial processing, color differentiation, and motion perception. Temporal lobe[edit] Main article: Temporal lobe The temporal lobe is located beneath the lateral fissure on both cerebral hemispheres of the mammalian brain.[7] The temporal lobe is involved in processing sensory input into derived meanings for the appropriate retention of visual memories, language comprehension, and emotion association.[8]:21 Within the temporal lobe is an area of the brain called the hippocampus which is associated with forming new memories and learning new things. The hippocampus has been studied many times in the past for its correlation with epilepsy showing there to be damage of this area. Although it has been difficult to determine the exact link between the temporal lobe and epilepsy, Chauvière 2020 suggests that there is a positive connection between the circuitry reorganization within the neurons and temporal lobe structure impacting rhythmic activities that are important for cognition. Women are found to have a better verbal memory than men Berger, Oltmanns, Holtkamp, & Bengner, 2017 . However, this study does not support the relationship between temporal lobe structural section and sex differences in memory which leaves researchers questioning the importance of these roles. Memory formation is also in it. Limbic lobe[edit] Main article: Limbic lobe The limbic lobe is an arc-shaped region of cortex on the medial surface of each cerebral hemisphere of the mammalian brain, consisting of parts of the frontal, parietal and temporal lobes. The term is ambiguous, with some authors[who?] including the paraterminal gyrus, the subcallosal area, the cingulate gyrus, the parahippocampal gyrus, the dentate gyrus, the hippocampus and the subiculum;[9] while the Terminologia Anatomica includes the cingulate sulcus, the cingulate gyrus, the isthmus of cingulate gyrus, the fasciolar gyrus, the parahippocampal gyrus, the parahippocampal sulcus, the dentate gyrus, the fimbrodentate sulcus, the fimbria of hippocampus, the collateral sulcus, and the rhinal sulcus, and omits the hippocampus. Insular cortex[edit] Main article: Insular cortex The insular cortex is a portion of the cerebral cortex folded deep within the lateral sulcus the fissure separating the temporal lobe from the parietal and frontal lobes . The insular cortex has an important function for sending axons to the amygdala and responding to tones and somatosensory stimulation Berret, Kintscher, Palchaudhuri, Tang, Osypenko, Kochubey, & Schneggenburge, 2019 Berret, et. al 2019 used mice to study the fear response that is associated with perceived threats from their memory of previously being shocked on their foot, finding adverse reflex responses in shocking stimulation whenever the insular cortex was silenced. This finding supports that the insular cortex takes information to specific amygdala subdivisions creating different components for fear behaviors Berret, et. al, 2019 . The insulae are believed to be involved in consciousness and play a role in diverse functions usually linked to emotion or the regulation of the body\'s homeostasis. These functions include perception, motor control, self-awareness, cognitive functioning, and interpersonal experience. In relation to these, it is involved in psychopathology. The insular cortex is divided into two parts: the larger anterior insula and the smaller posterior insula in which more than a dozen field areas have been identified. The cortical area overlying the insula toward the lateral surface of the brain is the operculum meaning lid . The opercula are formed from parts of the enclosing frontal, temporal, and parietal lobes. Additional images[edit] Interior view of brain. .mw-parser-output .legend ; '
CoreNLP OpenIE¶
In [4]:
req_data = step1
url = 'http://localhost:9000/'
headers = {
"Content-Type" : "application/x-www-form-urlencoded",
}
params = {
"properties": {
"annotators":"openie",
"outputFormat":"json",
}
}
url = '{}?{}'.format(url, urllib.parse.urlencode(params))
data = req_data.encode('ascii', "ignore")
req = urllib.request.Request(url, data, headers=headers)
with urllib.request.urlopen(req) as response:
result = json.loads(response.read(), object_pairs_hook=OrderedDict)
In [5]:
raw = result
In [6]:
entities = set([ele2['object'] for ele in result['sentences'] for ele2 in ele['openie']])
entities = [entitiy for entitiy in entities if 1 < len(entitiy.split())]
entities
Out[6]:
['purely anatomical classification', 'region of cortex on surface of cerebral hemisphere of mammalian brain consisting of parts of frontal lobes', 'arc shaped region consisting of parts of frontal lobes', 'processing input for appropriate retention of memories', 'arc shaped region of cortex consisting of parts of frontal lobes', 'region on surface of cerebral hemisphere of mammalian brain consisting of parts of frontal lobes', 'persons childhood from playing competitive sports from normal play', 'processing input for retention of visual memories', 'has studied times for its correlation', 'so cerebellum', 'region of cortex on surface of cerebral hemisphere of mammalian brain consisting of parts of lobes', 'persons childhood from sports from play', 'shaped region consisting of parts of frontal lobes', 'region on medial surface of cerebral hemisphere of mammalian brain consisting of parts', 'shaped region of cortex on surface of cerebral hemisphere of mammalian brain', 'region on surface of cerebral hemisphere of mammalian brain consisting of parts of lobes', 'processing sensory input into meanings for retention of visual memories', 'persons childhood from playing competitive sports', 'shaped region of cortex on medial surface of cerebral hemisphere of mammalian brain consisting', 'citations for verification', 'processing sensory input into meanings for appropriate retention of memories', 'In relation involved in psychopathology', 'If not specified', 'also called', 'verbal memory than men Berger 2017', 'additional citations for verification', 'processing sensory input for appropriate retention of memories', 'shaped region of cortex consisting of parts of lobes', 'better memory than men Berger 2017', 'processing input into derived meanings for appropriate retention of visual memories', 'persons childhood from normal play', 'additional citations', 'Primary cortex area 4', 'changes seen', 'arc shaped region of cortex on surface of cerebral hemisphere of mammalian brain consisting of parts', 'complex tasks organized', 'region of cortex consisting of parts', 'processing input into derived meanings for appropriate retention', 'has studied many times in past for its correlation with epilepsy', 'region consisting of parts of frontal lobes', 'persons childhood from playing competitive sports from play', 'shaped region on surface of cerebral hemisphere of mammalian brain consisting of parts', 'has studied times for its correlation with epilepsy', 'persons childhood from playing sports', 'region consisting of parts', 'arc shaped region of cortex on medial surface of cerebral hemisphere of mammalian brain consisting of parts of lobes', 'processing sensory input into derived meanings for appropriate retention of visual memories', 'shaped region', 'two parts', 'information among modalities', 'shaped region of cortex on medial surface of cerebral hemisphere of mammalian brain', 'can illustrated as distorted figure', 'processing sensory input for retention', 'processing input for retention of memories', 'has studied many times in past', 'arc shaped region consisting of parts', 'severe hit to head', 'exact link between temporal lobe', 'language processing', 'processing input into meanings for appropriate retention', 'persons childhood from play', 'whenever silenced', 'human brain', 'shaped region on medial surface of cerebral hemisphere of mammalian brain consisting of parts', 'has studied many times in past for its correlation', 'because can identified by stripe of myelin', 'goals organized', 'region of cortex on medial surface of cerebral hemisphere of mammalian brain', 'prefrontal cortex', 'information among various modalities including sense', 'deep lateral sulcus', 'processing sensory input into derived meanings for appropriate retention', 'processing input into derived meanings for retention', 'changes seen in matter', 'shaped region on surface of cerebral hemisphere of mammalian brain consisting of parts of frontal lobes', 'sense of touch mechanoreception in somatosensory cortex', 'arc shaped region of cortex consisting', 'because can identified by large stripe', 'processing input for appropriate retention', 'arc shaped region on surface of cerebral hemisphere of mammalian brain consisting of parts of lobes', 'has difficult', 'located on medial side within calcarine sulcus', 'arc shaped region on surface of cerebral hemisphere of mammalian brain consisting', 'regulation of meaningful stimuli', 'separated from lobe by space between tissues called', 'lateral fissure on cerebral hemispheres of mammalian brain', 'separated from parietal lobe by space between tissues called', 'shaped region consisting', 'information among various modalities including spatial sense', '6 lobes', 'posterior pole of lobe', 'verbal memory', 'persons childhood from playing sports from play', 'In relation to these involved in psychopathology', 'sensory information arriving from thalamus to forebrain', 'can identified by large stripe of myelin', 'tasks organized', 'also it', 'visual processing center of brain', 'processing input into derived meanings for retention of memories', 'region of cortex consisting', 'issues with long term memories', 'separated from lobe by space between tissues', 'involved in consciousness', 'link between temporal lobe', 'cortex area 4', 'processing input for appropriate retention of visual memories', 'originally classification', 'located on medial side of lobe within calcarine sulcus', 'calcarine sulcus', 'to related to different brain functions', 'often experienced', 'goals complex tasks organized', 'processing sensory input into meanings for retention of memories', 'fear response', 'may challenged', 'region on medial surface of cerebral hemisphere of mammalian brain consisting of parts of lobes', 'better verbal memory', 'region on medial surface of cerebral hemisphere of mammalian brain consisting', 'processing sensory input into meanings for appropriate retention of visual memories', 'navigation Jump', 'separated from parietal lobe by space called', 'region of cortex on surface of cerebral hemisphere of mammalian brain consisting', 'has studied many times for its correlation', 'shaped region of cortex on surface of cerebral hemisphere of mammalian brain consisting', 'posterior pole of occipital lobe', 'has studied times in past for its correlation with epilepsy', 'shaped region on surface of cerebral hemisphere of mammalian brain consisting of parts of lobes', 'processing sensory input for retention of visual memories', 'because can identified by large stripe of myelin', 'ventrolateral cortex', 'pole of occipital lobe', 'shaped region of cortex on surface of cerebral hemisphere of mammalian brain consisting of parts', 'changes seen in white matter within temporal areas', 'their lifetime', 'persons childhood from competitive sports from normal play', 'processing sensory input for retention of memories', 'region consisting', 'processing input into meanings for retention', 'exact link', 'can illustrated as figure', 'ventrolateral prefrontal cortex', 'severe hit', 'hit to head', 'visual processing center', 'region of cortex on surface of cerebral hemisphere of mammalian brain', 'has studied times', 'shaped region of cortex on surface of cerebral hemisphere of mammalian brain consisting of parts of frontal lobes', 'has studied many times for its correlation with epilepsy showing there', 'information arriving to forebrain', 'located on side within calcarine sulcus', 'parts of enclosing lobes', 'has studied times in past for its correlation', 'shaped region of cortex on surface of cerebral hemisphere of mammalian brain consisting of parts of lobes', 'shocking stimulation', 'better verbal memory than men Berger', 'arc shaped region on surface of cerebral hemisphere of mammalian brain consisting of parts of frontal lobes', 'often also called', 'region of cortex on medial surface of cerebral hemisphere of mammalian brain consisting of parts of frontal lobes', 'space between tissues', 'peoples behaviors', 'has studied many times in past for its correlation with epilepsy showing', 'has studied many times', 'processing sensory input into derived meanings for retention of memories', 'better memory than men Berger', 'Primary motor cortex area 4', 'Most often experienced', 'shaped region of cortex on medial surface of cerebral hemisphere of mammalian brain consisting of parts of frontal lobes', 'processing input into derived meanings for retention of visual memories', 'relation to these', 'main sensory receptive area for sense of touch mechanoreception in somatosensory cortex', 'verbal memory than men Berger', 'information among various modalities', 'can identified by stripe of myelin', 'processing sensory input into meanings for appropriate retention', 'arc shaped region of cortex on surface of cerebral hemisphere of mammalian brain consisting of parts of frontal lobes', 'shaped region consisting of parts', 'changes seen in white matter', 'goals tasks organized', 'shaped consisting', 'Gluck 2020', 'persons childhood from competitive sports from play', 'deep sulcus', 'sensory information arriving', 'Stria of Gennari', 'processing input into meanings for appropriate retention of visual memories', 'shaped region of cortex on medial surface of cerebral hemisphere of mammalian brain consisting of parts of lobes', 'arc shaped region of cortex consisting of parts of lobes', 'processing input', 'shaped region on surface of cerebral hemisphere of mammalian brain consisting', 'to involved', 'separated from parietal lobe by space', 'posterior pole', 'processing input into meanings for retention of memories', 'region of cortex on medial surface of cerebral hemisphere of mammalian brain consisting', 'primary areas of body', 'information arriving from thalamus', 'changes seen in matter within areas', 'processing sensory input into derived meanings for retention', 'because can identified by stripe', 'medial side', 'arc shaped region consisting of parts of lobes', 'region of cortex consisting of parts of frontal lobes', 'parietal lobe', 'has studied many times for its correlation with epilepsy', 'anatomical classification', 'processing sensory input into meanings for retention', 'processing sensory input into meanings', 'fissure on cerebral hemispheres of mammalian brain', 'changes seen in matter within temporal areas', 'arc shaped region', 'information among modalities including spatial sense', 'has studied times in past', 'issues with term memories', 'medial surface of cerebral hemisphere of mammalian brain', 'specific amygdala subdivisions', 'information arriving from thalamus to forebrain', 'persons childhood from competitive sports', 'side of lobe', 'arc shaped region on medial surface of cerebral hemisphere of mammalian brain consisting of parts', 'arc shaped region of cortex on medial surface of cerebral hemisphere of mammalian brain consisting', 'space between tissues called', 'often called', 'arc shaped region of cortex consisting of parts', 'If specified', 'has studied times in past for its correlation with epilepsy showing there', 'processing input into meanings for retention of visual memories', 'processing center of brain', 'occipital lobe', 'medial side of lobe', 'shaped region on medial surface of cerebral hemisphere of mammalian brain consisting', 'located on side of lobe within calcarine sulcus', 'pole of lobe', 'better verbal memory than men Berger 2017', 'devoted to them', 'cingulate gyrus', 'arc shaped region on medial surface of cerebral hemisphere of mammalian brain consisting', 'shaped region of cortex consisting of parts', 'postcentral gyrus', 'has studied times for its correlation with epilepsy showing there', 'changes seen in white matter within frontal temporal areas', 'persons childhood', 'shaped region of cortex on medial surface of cerebral hemisphere of mammalian brain consisting of parts', 'region of cortex on medial surface of cerebral hemisphere of mammalian brain consisting of parts', 'processing center', 'Parts of cerebrum', 'development of psychosis', 'information arriving', 'shaped region of cortex consisting of parts of frontal lobes', 'visual processing center of mammalian brain', 'changes seen in matter within frontal temporal areas', 'arc shaped region consisting', 'arc shaped region of cortex on medial surface of cerebral hemisphere of mammalian brain consisting of parts of frontal lobes', 'sensory information arriving to forebrain', 'link between lobe', 'Brodmann area 17', 'memory than men Berger 2017', 'shaped region on medial surface of cerebral hemisphere of mammalian brain consisting of parts of frontal lobes', 'separated from lobe by space', 'has studied times for its correlation with epilepsy showing', 'has studied many times in past for its correlation with epilepsy showing there', 'primary areas', 'parts of lobes', 'can illustrated', 'arc shaped region on surface of cerebral hemisphere of mammalian brain consisting of parts', 'processing input into derived meanings', 'region on surface of cerebral hemisphere of mammalian brain consisting', 'have identified', 'region consisting of parts of lobes', 'amygdala subdivisions', 'developing symptoms associated with schizophrenia Jain', 'region of cortex on medial surface of cerebral hemisphere of mammalian brain consisting of parts of lobes', 'region on medial surface of cerebral hemisphere of mammalian brain consisting of parts of frontal lobes', 'processing sensory input into derived meanings', 'arc shaped region on medial surface of cerebral hemisphere of mammalian brain consisting of parts of frontal lobes', 'parts of frontal lobes', 'changes seen in white matter within areas', 'shaped region of cortex consisting', 'can identified by large stripe', 'processing sensory input into derived meanings for appropriate retention of memories', 'most of neurons', 'arc shaped region of cortex on surface of cerebral hemisphere of mammalian brain', 'extrastriate cortex', 'motor cortex area 4', 'arc shaped region on medial surface of cerebral hemisphere of mammalian brain consisting of parts of lobes', 'shaped region consisting of parts of lobes', 'processing center of mammalian brain', 'originally anatomical classification', 'processing sensory input for appropriate retention', 'can identified by stripe', 'striate cortex', 'region of cortex consisting of parts of lobes', 'exact link between lobe', 'not specified', 'somatosensory cortex', 'free encyclopedia Jump to navigation Jump', 'region on surface of cerebral hemisphere of mammalian brain consisting of parts', 'parts of enclosing frontal lobes', 'Although has difficult', 'sensory information', 'has studied times in past for its correlation with epilepsy showing', 'space called', 'persons childhood from sports', 'better memory', 'region of cortex on surface of cerebral hemisphere of mammalian brain consisting of parts', 'most of dopamine delicate neurons', 'long term memories', 'originally purely anatomical classification', 'memory than men Berger', 'shaped region on medial surface of cerebral hemisphere of mammalian brain consisting of parts of lobes', 'to involved in consciousness', 'epilepsy showing there', 'information among modalities including sense', 'processing input into derived meanings for appropriate retention of memories', 'lateral sulcus', 'surface of cerebral hemisphere of mammalian brain', 'shown.Medial surface', 'processing sensory input for appropriate retention of visual memories', 'has studied many times for its correlation with epilepsy showing', 'processing sensory input into derived meanings for retention of visual memories', 'areas of body', 'arc shaped region of cortex on surface of cerebral hemisphere of mammalian brain consisting', 'persons childhood from playing sports from normal play', 'processing sensory input', 'processing input for retention', 'sensory information arriving from thalamus', 'separated from lobe by space called', 'arc shaped region of cortex on medial surface of cerebral hemisphere of mammalian brain', 'commonly right superior parietal lobule', 'arc shaped region of cortex on surface of cerebral hemisphere of mammalian brain consisting of parts of lobes', 'arc shaped region of cortex on medial surface of cerebral hemisphere of mammalian brain consisting of parts', 'regulation of stimuli', 'persons childhood from sports from normal play', 'processing input into meanings', 'separated from parietal lobe by space between tissues', 'processing input into meanings for appropriate retention of memories']
広義に名詞といえる範囲にないもの「often called」, 「not specified」が目立ちますね. 制限したいところです.
CoreNLP POS + NLTK RegexpParser¶
In [7]:
req_data = step1
url = 'http://localhost:9000/'
headers = {
"Content-Type" : "application/x-www-form-urlencoded",
}
params = {
"properties": {
"annotators":"pos",
"outputFormat":"json",
}
}
url = '{}?{}'.format(url, urllib.parse.urlencode(params))
data = req_data.encode('ascii', "ignore")
req = urllib.request.Request(url, data, headers=headers)
with urllib.request.urlopen(req) as response:
result = json.loads(response.read(), object_pairs_hook=OrderedDict)
In [8]:
entities = []
cp = nltk.RegexpParser('CHUNK: {<JJ> <N.*> +}')
for smpl in result['sentences']:
smpl = smpl['tokens']
sent = [(token['word'], token['pos']) for token in smpl]
tree = cp.parse(sent)
for subtree in tree.subtrees():
if subtree.label() == 'CHUNK':
if 1 < len(subtree):
entities.append(''.join([subsubtree[0][0]+' ' for subsubtree in subtree.pos()]))
In [9]:
entities
Out[9]:
['free encyclopedia Jump ', 'additional citations ', 'reliable sources ', 'Unsourced material ', 'Cerebral lobesLateral surface ', 'shown.Medial surface ', 'anatomical classification ', 'different brain functions ', 'human brain ', 'different sub regions ', 'full function ', 'Frontal lobe ', 'Parietal lobe ', 'Occipital lobe ', 'Temporal lobe ', 'Limbic lobe ', 'Insular cortex ', 'Additional images ', 'External links ', 'Frontal lobe ', 'Main article ', 'Frontal lobe ', 'frontal lobe ', 'cerebral hemisphere ', 'parietal lobe ', 'temporal lobe.It ', 'parietal lobe ', 'central sulcus ', 'temporal lobe ', 'deep fold ', 'lateral sulcus ', 'precentral gyrus ', 'posterior border ', 'frontal lobe ', 'primary motor cortex ', 'voluntary movements ', 'specific body parts.Precentral region ', 'motor cortex area ', 'frontal lobe ', 'delicate neurons ', 'cerebral cortex ', 'sensory information ', 'prefrontal cortex ', 'inefficient functioning ', 'frontal lobe ', 'prefrontal cortex ', 'frontal lobe ', 'executive control ', 'complex tasks ', 'prefrontal cortex ', 'prefrontal cortex ', 'prefrontal cortex ', 'different divisions ', 'prefrontal cortex ', 'prefrontal cortex ', 'prefrontal cortex ', 'executive control ', 'episodic memory ', 'prefrontal cortex ', 'meaningful stimuli ', 'prefrontal cortex ', 'long term ', 'traumatic brain injuries TBI ', 'severe hit ', 'competitive sports ', 'normal play ', 'traumatic brain injury ', 'psychiatric problems ', 'white matter ', 'temporal areas ', 'Parietal lobe ', 'Main article ', 'Parietal lobe ', 'parietal lobe ', 'occipital lobe ', 'frontal lobe ', 'central sulcus ', 'parietal lobe ', 'sensory information ', 'various modalities ', 'spatial sense ', 'receptive area ', 'somatosensory cortex ', 'central sulcus ', 'postcentral gyrus ', 'dorsal stream ', 'visual system ', 'sensory inputs ', 'parietal lobe ', 'Several areas ', 'parietal lobe ', 'somatosensory cortex ', 'distorted figure ', 'little man ', 'somatosensory cortex ', 'parietal lobule ', 'parietal lobule ', 'primary areas ', 'spatial awareness ', 'parietal lobule ', 'Occipital lobe ', 'Main article ', 'Occipital lobe ', 'occipital lobe ', 'visual processing center ', 'mammalian brain ', 'anatomical region ', 'visual cortex ', 'visual cortex ', 'visual one ', 'Human V1 ', 'medial side ', 'occipital lobe ', 'full extent ', 'posterior pole ', 'occipital lobe ', 'striate cortex ', 'large stripe ', 'extrastriate cortex ', 'extrastriate regions ', 'visual tasks ', 'visuospatial processing ', 'Temporal lobe ', 'Main article ', 'Temporal lobe ', 'temporal lobe ', 'lateral fissure ', 'cerebral hemispheres ', 'mammalian brain ', 'temporal lobe ', 'sensory input ', 'appropriate retention ', 'visual memories ', 'temporal lobe ', 'new memories ', 'new things ', 'many times ', 'exact link ', 'temporal lobe ', 'positive connection ', 'temporal lobe structure ', 'rhythmic activities ', 'verbal memory ', 'temporal lobe ', 'structural section ', 'Limbic lobe ', 'Main article ', 'Limbic lobe ', 'limbic lobe ', 'medial surface ', 'cerebral hemisphere ', 'mammalian brain ', 'temporal lobes ', 'paraterminal gyrus ', 'subcallosal area ', 'parahippocampal gyrus ', 'fasciolar gyrus ', 'parahippocampal gyrus ', 'parahippocampal sulcus ', 'rhinal sulcus ', 'Insular cortex ', 'Main article ', 'Insular cortex ', 'insular cortex ', 'cerebral cortex ', 'lateral sulcus ', 'temporal lobe ', 'frontal lobes ', 'insular cortex ', 'important function ', 'somatosensory stimulation Berret ', 'adverse reflex responses ', 'shocking stimulation ', 'insular cortex ', 'insular cortex ', 'specific amygdala subdivisions ', 'different components ', 'diverse functions ', 'cognitive functioning ', 'interpersonal experience ', 'insular cortex ', 'anterior insula ', 'posterior insula ', 'cortical area ', 'lateral surface ', 'parietal lobes ', 'Additional images ']
なかなか:)