Coder Social home page Coder Social logo

Comments (25)

SujaySKumar avatar SujaySKumar commented on April 25, 2024 5

I am facing the same issue of Duckling giving a future date. For example, "in June" gives "June 2020". I do not see how I can override this assumption in duckling http server. Any help would be appreciated.

from duckling.

alph486 avatar alph486 commented on April 25, 2024 2

@patapizza Yep, thanks for the summary I think thats the gist of it!

from duckling.

jameshaydon avatar jameshaydon commented on April 25, 2024 2

@patapizza

In our project we combine Duckling with a Natural Language parser.
Our requirements are similar to those from @alph486, with respect to Time.

We want to add new attributes to Time, such as repeated=True/False for a rule that should recognize every two hours, and add new modules like recognition of chemical formulae. While these might be mergable upstream later, some of the requirements are rather specific so we would like to develop them as an add-on first, and split off what is likely to be generally useful to other people later.

We are adding new dimensions which are very domain specific. For example we are creating a Command dimension for various sorts of actions the user may want to perform, which only make sense in the specific context of our app.

One last element is the training of the classifier rules. We are planning to add examples that come from our client and thus can't be shared. It would be useful to have a way to merge specify external training sets, or even external classifiers.

from duckling.

patapizza avatar patapizza commented on April 25, 2024 1

Thanks for the additional context @alph486.

This does make sense.
I see two different use cases here.

  1. Allow to override assumptions (Time dimension)
    Today, we make assumptions in the way we resolve time tokens. These assumptions are encoded in the rules. Some use cases might be handled by the support of locales (#33) (e.g. Thanksgiving in USA vs Canada, seasons). More flexibility would be great for other examples like parts of days (e.g. "morning" is between 4am to 11am, "lunch" is between 12pm and 1pm).

  2. Allow to plug-in custom dimensions
    In the way dimensions are designed today, one can't provide its own set without affecting all users. It would be great to allow for shallow dimensions (e.g. config files), to accommodate specific use cases.

Does this make sense?

from duckling.

zliu41 avatar zliu41 commented on April 25, 2024 1

Custom dimensions are now enabled with 5460d8d. An example is available in exe/CustomDimensionExample.hs. Let me know if there are any questions!

from duckling.

tbaptista avatar tbaptista commented on April 25, 2024 1

Great to see an update on this issue.

Although I see that the support for custom dimensions is now available, I did not understand from the example code how it supports overriding assumptions on the already available dimensions.

Thanks!

from duckling.

zliu41 avatar zliu41 commented on April 25, 2024 1

@tbaptista I think you are right :) Let's keep this issue open until we figure out a proper story for extending existing dimensions.

from duckling.

patapizza avatar patapizza commented on April 25, 2024

Hi @alph486,

What dimensions do you have in mind? Can you provide a bit more context on how you would like to extend them? A few examples would be great.

Thanks!

from duckling.

shaoyx avatar shaoyx commented on April 25, 2024

Hi @patapizza,
I have a similar demand with @alph486. For example, if I want to a new Dimension, like Location, to Duckling. Is it possible to do the task by extending the project, not editing the source code?

from duckling.

patapizza avatar patapizza commented on April 25, 2024

Hi @simon0227,

What do you mean by extending the project? One way to do this is to fork the repository, and edit the source code on your end to allow for new dimensions.
As far as I know, it is not straightforward to extend Duckling to fully support locations: it would require some kind of database query. What is the scope for location that you need?

Thanks

from duckling.

alph486 avatar alph486 commented on April 25, 2024

@patapizza A good example of something we would like to do is change the definitions of "Summer" or "Fall", or even add an additional dimension that would support our meanings for things like this without affecting the "core" of Duckling.

I work at a travel software company and depending on the customer and their customer's locale, these things could be different. So it would be nice to be able to "override" the functionality inside Duckling's dimensions without having to maintain a fork of the project.

What @simon0227 is asking is similar. Instead of creating and maintaining a fork to be up to date with the source, adding things that may or may not have value to others as part of the main project, it would be ideal to be able have drop-in / import style customizations for these parts of the platform. Making this extensible not only solves custom Rules and maintenance for users in the short term, but increases the probability that folks may evolve their customizations into things that the main project needs. This may foster more PRs and improvement over time.

Anyway, hope that makes sense.

from duckling.

shaoyx avatar shaoyx commented on April 25, 2024

Hi @patapizza
I think @alph486 gives a good example. I need the similar feature of adding new dimensions depending on some customised requirements.

from duckling.

jameshaydon avatar jameshaydon commented on April 25, 2024

I am also working on a project which would need custom extensions to Duckling.

@patapizza do you have any ideas of how this will work yet? Even maybe an ETA?

Thanks!

from duckling.

patapizza avatar patapizza commented on April 25, 2024

@jameshaydon Not yet. To help the discussion, can you share which custom extensions are you thinking of?

Thanks

from duckling.

hammad7 avatar hammad7 commented on April 25, 2024

Any update or documentation yet for extending Custom dimensions. exe/CustomDimensionExample.hs

from duckling.

patapizza avatar patapizza commented on April 25, 2024

@hammad7 Custom dimensions are ready to use; use the provided example file to bootstrap your own.

from duckling.

cchanwy avatar cchanwy commented on April 25, 2024

I have the same problem as @SujaySKumar . I want to override the assumption of returning future date and return the past date instead. I am running duckling in docker. Can I do this in duckling http server?

from duckling.

patapizza avatar patapizza commented on April 25, 2024

Overriding assumptions hasn't been implemented yet. In the meantime, a workaround could be to define a custom Time dimension and cherry picking the rules, and extending with your own.

from duckling.

jm8985 avatar jm8985 commented on April 25, 2024

This is also an issue for me. A user types "clock time from 1pm to 2pm", and it results in the date being the next day. I'm working around this by using Spacy NLP to parse words and resubmit with "1 pm to 2 pm today". It would be so much simpler if we could change the default assumption.

from duckling.

argideritzalpea avatar argideritzalpea commented on April 25, 2024

Has anyone made a branch to be able to override the future assumption to the past?

from duckling.

chessai avatar chessai commented on April 25, 2024

Just finding this issue.

Currently there is no API for how to do this. I'm going to keep this on my radar of things to think about. If anyone has any thoughts for the structure of such an API, please let me know.

from duckling.

tstuessi avatar tstuessi commented on April 25, 2024

I'd like to bump this as well! My org is trying to use this to parse when events started, and being able to change "Wednesday" to look in the past rather than the future would be very helpful. If you have guidance as well on what changes might work as a workaround, I'd be interested in exploring it.

EDIT: I found a way to do this. See my fork: https://github.com/tstuessi/duckling I edited the regex rule creation to return the previous weekday rather than the next one. Doesn't completely work in all cases, but all this took was essentially shimming in some functions that altered how things evaluated.

from duckling.

Sushanti99 avatar Sushanti99 commented on April 25, 2024

Hey @chessai I have a question related to this issue:

When I type 10th april to 12th april:
My result consists of
from: 10th april
to: 13th april

Is there anyway I can change the 'to' to not point to the future day and point to '12th april'?

from duckling.

chessai avatar chessai commented on April 25, 2024

Hey @chessai I have a question related to this issue:

When I type 10th april to 12th april:
My result consists of
from: 10th april
to: 13th april

Is there anyway I can change the 'to' to not point to the future day and point to '12th april'?

Duckling intervals are upper exclusive based on the grain, so duckling is returning the correct dates here.

from duckling.

bawa-v avatar bawa-v commented on April 25, 2024

Hi,
In my use case, we want duckling to recognize german phrases like "ende März" as 31.03.2023 or "Mitte März" as 15.03.2023. After pre-tests I am also expecting to get some dialects from the users that I would like to incorporate as a regex in /Duckling/Time/DE/Rules.hs

I am spinning duckling as a docker via the latest image on dockerhub https://hub.docker.com/r/rasa/duckling

What is the best way to edit rules based on users' feedback?

from duckling.

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.