Code Monkey home page Code Monkey logo

Comments (14)

spyysalo avatar spyysalo commented on August 18, 2024

We're working on this, and there's a workaround with \n that's being used for the time being, see e.g. http://universaldependencies.github.io/docs/fi/nsubj.html .

from docs.

manning avatar manning commented on August 18, 2024

Right, I saw that, but that's pretty bad for several reasons (the extra line of unnecessary brat nodes, the words don't align vertically in columns with what they are glossing...). Great to know it's being worked on.

from docs.

dan-zeman avatar dan-zeman commented on August 18, 2024

Is the workaround with \n somehow available also for the conllu input? I would use it in a French example that contains a multi-word token, which I think can only be done in CoNLL-U.

from docs.

spyysalo avatar spyysalo commented on August 18, 2024

@dan-zeman : The \n trick isn't implemented for CoNLL-U. I had kind of vaguely thought that it would not be necessary as the CoNLL-U supports multiple sentences per example (standard syntax), but now that I think about it, the validation requires a parse tree for each, so you couldn't quite get the same effect as with \n for SD ... I'll think about this a bit. It would be helpful if you could provide me with your example in standard CoNLL-U to test with.

from docs.

dan-zeman avatar dan-zeman commented on August 18, 2024

It did not occur to me that I could provide several sentences in one example. That is probably sufficient, thanks, I will try it. CoNLL-U itself is not replacement for sdparse, exactly because you have to supply the full tree. But I still thought it should be used when the words and tokens do not match. The example is below. What it shows in case.md (just committed) could be shown even without splitting the "aux" token but I thought we should split it so that all our examples match what we say about words and tokens elsewhere.

~~~ conllu
# give the toys to the children
1     donner    donner   VERB   _   VerbForm=Inf               0   root   _   give
2     les       le       DET    _   Definite=Def|Number=Plur   3   det    _   the
3     jouets    jouet    NOUN   _   Gender=Masc|Number=Plur    1   dobj   _   toys
4-5   aux       _        _      _   _                          _   _      _   _
4     au        au       ADP    _   _                          6   case   _   to
5     les       le       DET    _   Definite=Def|Number=Plur   6   det    _   the
6     enfants   enfant   NOUN   _   Gender=Masc|Number=Plur    1   nmod   _   children
~~~

from docs.

spyysalo avatar spyysalo commented on August 18, 2024

OK, glad to hear you can work with the current implementation. I'm considering providing some special syntax to switch off validation for treeness to allow e.g. text-only translations, but would prefer to avoid having the JS CoNLL-U parser deviate from the spec.

from docs.

dan-zeman avatar dan-zeman commented on August 18, 2024

So here is the bad news. When I tried to insert a two-sentence CoNLL-U example (see below), it completely disappeared and the visualisations in the rest of the page are broken too (ce3d607 which I am now going to revert).

~~~ conllu
# give the toys to the children
1     donner    donner   VERB   _   VerbForm=Inf               0   root   _   give
2     les       le       DET    _   Definite=Def|Number=Plur   3   det    _   the
3     jouets    jouet    NOUN   _   Gender=Masc|Number=Plur    1   dobj   _   toys
4-5   aux       _        _      _   _                          _   _      _   _
4     au        au       ADP    _   _                          6   case   _   to
5     les       le       DET    _   Definite=Def|Number=Plur   6   det    _   the
6     enfants   enfant   NOUN   _   Gender=Masc|Number=Plur    1   nmod   _   children

# now the parallel English tree
1     give       donner   VERB   _   VerbForm=Inf               0   root   _   give
2     the        le       DET    _   Definite=Def|Number=Plur   3   det    _   the
3     toys       jouet    NOUN   _   Gender=Masc|Number=Plur    1   dobj   _   toys
4     to         au       ADP    _   _                          6   case   _   to
5     the        le       DET    _   Definite=Def|Number=Plur   6   det    _   the
6     children   enfant   NOUN   _   Gender=Masc|Number=Plur    1   nmod   _   children
~~~

from docs.

spyysalo avatar spyysalo commented on August 18, 2024

Hey, a bug! Thank you for catching this. I'm guessing something goes wrong with the offsets when adding the extra "sentence" for the token sequence. Could you please open an issue specific to this? I'll check this first thing tomorrow.

from docs.

spyysalo avatar spyysalo commented on August 18, 2024

Also, it's likely that some error will be shown on the JavaScript console when the visualization goes wrong. It would be helpful if you could provide this information with the issue. Thanks!

from docs.

spyysalo avatar spyysalo commented on August 18, 2024

(resolved in #68)

from docs.

dan-zeman avatar dan-zeman commented on August 18, 2024

Thanks, Sampo! It works for me now.

from docs.

trf0412 avatar trf0412 commented on August 18, 2024

I think I'm trying to do what's described here, but since I've only just started using Brat I'm not 100% sure. Is there any way you can post an example image (or link) showing what you achieved in Brat?

Thanks,
Tim

from docs.

manning avatar manning commented on August 18, 2024

@spyysalo You might be able to answer the above question from June. I presume we should move this to "later" since it's not being worked on for release 1.2....

from docs.

dan-zeman avatar dan-zeman commented on August 18, 2024

I am not sure if @trf0412 's question was directed at me but anyway. Consider the above code, which I am repeating here:

~~~ conllu
# give the toys to the children
1     donner    donner   VERB   _   VerbForm=Inf               0   root   _   give
2     les       le       DET    _   Definite=Def|Number=Plur   3   det    _   the
3     jouets    jouet    NOUN   _   Gender=Masc|Number=Plur    1   dobj   _   toys
4-5   aux       _        _      _   _                          _   _      _   _
4     au        au       ADP    _   _                          6   case   _   to
5     les       le       DET    _   Definite=Def|Number=Plur   6   det    _   the
6     enfants   enfant   NOUN   _   Gender=Masc|Number=Plur    1   nmod   _   children
# now the parallel English tree
1     give       donner   VERB   _   VerbForm=Inf               0   root   _   give
2     the        le       DET    _   Definite=Def|Number=Plur   3   det    _   the
3     toys       jouet    NOUN   _   Gender=Masc|Number=Plur    1   dobj   _   toys
4     to         au       ADP    _   _                          6   case   _   to
5     the        le       DET    _   Definite=Def|Number=Plur   6   det    _   the
6     children   enfant   NOUN   _   Gender=Masc|Number=Plur    1   nmod   _   children
~~~

If it is included in the source of a page here in the documentation system, here is what you get:

image

Note that some information is only visible when you place your mouse cursor over a node (the "enfants" frame in the upper right part).

from docs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.