LxMLS / lxmls-toolkit

Machine Learning applied to Natural Language Processing Toolkit used in the Lisbon Machine Learning Summer School
Other
223 stars 215 forks source link

Check difference in parsing exercises in python 2.7/3.5 and python 3.6 #89

Closed pedrobalage closed 6 years ago

pedrobalage commented 6 years ago

The unit tests works very well for python 2.7 and python 3.5, but fails in python 3.6.

To solve this issue, you may need to check how the parsing algorithms are working and find the reason for the different final weights.

I guess this problem maybe because a different dict implementation for python 3.6 (https://docs.python.org/3/whatsnew/3.6.html#whatsnew36-compactdict).

dcferreira commented 6 years ago

Fix is changing https://github.com/LxMLS/lxmls-toolkit/blob/a07370b7e7c8650a9b5cd8460387fefcaf68c342/lxmls/parsing/dependency_decoder.py#L274 to:

        cyc_nodes = sorted(list(cycle.keys()))

and update the tests for exercises 2, 3a, 3b, 3c, 5.

I'd make a PR, but I am not quite sure from which branch to which (I guess #88 needs to be merged beforehand).

pedrobalage commented 6 years ago

Thanks @dcferreira! I will fix this directly in the pull request, so all tests may pass.