问题
Extract out each sentence from the document.(cricket.txt) Check for each tag of the word in tagged-text.txt If word is N-NNP then assign it to subject_list, if word is QT-QTC, N-NN, PR-PRP then assign it to object_list, if word is V_VM_VF then assign it to verb_list Create a graph for each sentence in the document.
I'm using Python 2.7 on Jupyter Notebook.
for subject in subject_list:
s=subject.decode('utf-8')
graph.add_node(s)
labels[s]=s
Example: Tommy Dias is drinking milk. Tommy/N-NNP, Dias/N-NNP, is/V-VM_VF, drinking/V-VM-VF, milk/N-NN Tommy Dias-> is drinking-> milk
来源:https://stackoverflow.com/questions/55553495/how-to-draw-a-graph-for-each-sentence-in-the-document-based-on-the-tags-assigned