yzhangcs / parser

:rocket: State-of-the-art parsers for natural language.
https://parser.yzhang.site/
MIT License
825 stars 138 forks source link

POS tagging #94

Closed K-WeiMing closed 2 years ago

K-WeiMing commented 2 years ago

Hi,

as noted in the README.md, there is an example provided

con = Parser.load('crf-con-en')
con.predict(['I', 'saw', 'Sarah', 'with', 'a', 'telescope', '.'], verbose=False)[0].pretty_print()

I would like to find out how to enable POS tagging in the generated predictions. Thank you.

yzhangcs commented 2 years ago

@K-WeiMing Hi, sorry that currently POS tagging is not supported by the released crf parser. POS tags are taken to be indivisible from their corresponding word terminals, and are therefore transparent to parser training.

K-WeiMing commented 2 years ago

I've been looking at the code to explore if I can enable the POS tagging within the training / eval / prediction and I'm stuck, it would be great if you can point me in a rough direction on where to look to modify the required lines. Thank you!

yzhangcs commented 2 years ago

@K-WeiMing Integerating POS tags into a constituency tree could face many potential issues. Hope this paper will be of some help to you.

K-WeiMing commented 2 years ago

Thanks for your quick reply, I will look into the suggested paper. Appreciate it.