Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Two ROOT objects #512

Closed
AlexZaytsav opened this issue Sep 30, 2016 · 2 comments
Closed

Two ROOT objects #512

AlexZaytsav opened this issue Sep 30, 2016 · 2 comments
Labels
lang / en English language data and models models Issues related to the statistical models

Comments

@AlexZaytsav
Copy link

Hi

We have written some kind of wrapper to get parsed dependencies tree:

import spacy
nlp = spacy.load('en')
from __future__ import unicode_literals

def parse(text):
    result = {}
    tokens = nlp(text)
    for token in tokens:
        if token.head == token:
            explore(token, result)
    return result

def explore(token, result):
    if token.pos_ != 'PRON':
        print token.dep_
        print token.orth_
        result[token.dep_] = token.orth_
    for idx, child in enumerate(token.children):
        result[idx] = {}
        explore(child, result[idx])

Problem is that there are some kind of queries which returns several ROOT objects, not sure if it's an expected behaviour, but in our wrapper or even a bug in the Spacy. Will be glad to get any help!

'Bugged' query example: 'find leads first_name Alex'
Python version: 2.7.11
Spacy version: 0.101.0

Thanks,
Alex.

@ines ines added this to the Debug parser transition system milestone Feb 18, 2017
@ines ines added docs Documentation and website models Issues related to the statistical models lang / en English language data and models and removed docs Documentation and website models Issues related to the statistical models labels May 13, 2017
@ines
Copy link
Member

ines commented May 13, 2017

Closing this and making #1057 the master issue – work in progress for spaCy v2.0!

@ines ines closed this as completed May 13, 2017
@lock
Copy link

lock bot commented May 8, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators May 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lang / en English language data and models models Issues related to the statistical models
Projects
None yet
Development

No branches or pull requests

3 participants