-1

I need to be able to find references of law names on legal texts. The idea is to be able to extract the type of the law, the number and the date. The target text is in Brazilian Portuguese. Say i have:

"Lei nº 1.324 de 15 de maio de 2019"

The intended output would be:

{"type": "Lei", "number": 1324, "date": "2019-05-15"}

The structure of how the law name is written may vary in different ways, for instance, the date format may change, the "nº" may be written using a single "n", there might be misspelling etc.

I started out using python 3.6 regex, but now I am wondering if that is the best approach. Should i look into nlp? I started taking a look at the SpaCy library but i can't help but feel that it is an overkill, for the references that I am searching for are ruffly structured and I don't need to rely on the context to find them.

New contributor
PJ4233 is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Your Answer

PJ4233 is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.