explosion / explosion/spaCy

Spacy split the sentence when I try to change the head of a root token

Open
#10,526 2 comments 0 reactions 0 assignees View on GitHub
experimental feat / doc
Dominant language
Python
Stars
33.9k
Forks
4.7k
Avg merge
3m
Merged PRs (30d)
1

Description

The first thing that I found is the experimental biaffine parser can parse sentences with multiple roots. (I thought about the reporting of this situation as an issue, but dependency trees can include multiple heads to the root. Instead of the Universal Dependencies, there are treebanks that do not contain any restriction for the number of heads that point to the root.) After that, I wanted to make a pipeline component that can select one token with root head by linguistic rules and connect the others to that. I used the setter of the token “head” attribute. The first irregular observation was: in some cases, this modification split the sentence into two.
My second observation was when I tried to serialize/deserialize a Doc with pickle the deserialized Doc contained two sentences instead of one.

## How to reproduce the behaviour
There is a [gist ](https://gist.github.com/zsozso21/266386e73bc851db0765aa93119f3122)that reproduce the above mentioned behaviors on a Hungarian example.

## Your Environment
* Operating System: Ubuntu 20.04.3 LTS
* Python Version Used: 3.8.5
* spaCy Version Used: 3.2.3
* Environment Information: spacy-experimental: git+https://github.com/explosion/spacy-experimental.git@3eca6174f3d7a48e959c77a2560428b4412d3e91

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.