yzhangcs / parser

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

Constituency Multilinugal model not working properly #132

Closed SirBernardPhilip closed 1 year ago

SirBernardPhilip commented 1 year ago

Same as issue #131 but with the con-cr-xlmr model:

>>> from supar import Parser
>>> model_name = "con-crf-xlmr"
>>> parser = Parser.load(model_name)
>>> parser.predict(['Je', 'ai', 'vu', 'Sarah', 'avec', 'un', 'télescope', '.'], verbose=False, prob=True)[0].pretty_print()
             TOP                        
              |                          
              S                         
  ____________|_______________________   
 _   _   _    _    _    _      _      _ 
 |   |   |    |    |    |      |      |  
 Je  ai  vu Sarah avec  un télescope  . 

Originally posted by @SirBernardPhilip in https://github.com/yzhangcs/parser/issues/131#issuecomment-1752586753

yzhangcs commented 1 year ago

@SirBernardPhilip Hi, sorry for my late reply. The file is updated as well.

>>> >>> parser.predict(['Je', 'ai', 'vu', 'Sarah', 'avec', 'un', 'télescope', '.'], verbose=False, prob=True)[0].pretty_print()
             TOP                            
              |                              
             SENT                           
      ________|___________________________   
     |        |         PP                | 
     |        |     ____|___              |  
     VN       NP   |        NP            | 
  ___|___     |    |     ___|______       |  
 _   _   _    _    _    _          _      _ 
 |   |   |    |    |    |          |      |  
 Je  ai  vu Sarah avec  un     télescope  .