Created
July 2, 2017 17:04
-
-
Save ettorerizza/058cb462a684230ee5a48dddf8fb6129 to your computer and use it in GitHub Desktop.
OpenRefine/jython POS tagging with parsetree
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment