shixzie / nlp

[UNMANTEINED] Extract values from strings and fill your structs with nlp.
MIT License
389 stars 34 forks source link

Question around ignoring trailing text #6

Open rafael opened 6 years ago

rafael commented 6 years ago

Hi!

Thank you for pulling together this awesome library.

I have a question related to trailing text.

Let's say that I'm using the model from the README, and I have the following input:

s := nl.P("hello sir can you pleeeeeease play King by Lauren Aquilina ????") 

I would like ???? to be considered trash so the artist remains Lauren Aquilina. Is there a way to train the model in that way ? I was trying to play with the limits, but no luck.

shixzie commented 6 years ago

Hello!

Answering your question: no, there's no current way of capping the length of the trailing field since it's supposed that you don't know the length of whatever is in the text, but a model option may allow word-capping of the trailing field.

nlp.WithTrailingWordCap()