yzhangcs / parser

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

Parenthesis are not parsable #109

Closed MBAnslow closed 1 year ago

MBAnslow commented 1 year ago

Using predict(['This', 'is', '(not)', 'parsable', '!']) with the crf-con-en model doesn't work. I suspect you work with a parenthesis representation of the string which probably causes this conflict.

yzhangcs commented 1 year ago

@MBAnslow Hi, this issue has been solved by the latest commits:

>>> parser.predict(['This', 'is', '(not)', 'parsable', '!'], verbose=False)[0].pretty_print()\
              TOP                       
               |                         
               S                       
  _____________|______________________   
 |             VP                     | 
 |     ________|________              |  
 NP   |                ADJP           | 
 |    |         ________|______       |  
 _    _        _               _      _ 
 |    |        |               |      |  
This  is -LRB-not-RRB-      parsable  ! 

Please check it out :) (see https://github.com/yzhangcs/parser/commit/fe5c20395950187989955444a72c8a0e021ee389).

MBAnslow commented 1 year ago

Great! Thanks for fixing this quickly!