ettorerizza
7/2/2017 - 5:04 PM

OpenRefine/jython POS tagging with parsetree

OpenRefine/jython POS tagging with parsetree

import sys
sys.path.append(r'D:\jython2.7.0\Lib\site-packages')
from pattern.fr import parsetree

sentences = parsetree(value, relations=True, lemmata=True)

liste = []
for s in sentences:
    for chunk in s.chunks:
        for w in chunk.words:
            if w.type=="NNP":
                liste.append(chunk.string)

return ":::".join(liste)