1
$\begingroup$

I need to understand whether it is better to use AI algorithms (ML, DL, etc.) instead of the classic parser (based onto grammars with regular expression and automaton) for the following task: structuring in XML an unstructured plain text.

The text is a legal document, so the structure is well defined and a classic parser could do a good job.

In the case AI could be a viable way, what would be an appropriate approach for the task?

$\endgroup$
1
$\begingroup$

The question confuses ML (including DL) with AI. AI is a bigger field than ML and includes rule-based systems

You probably need to extract entities (spans of text) from the unstructured text and embed them into an XML. ML (and DL) are good when the problem is fuzzy (you need very many rules to solve the problem) so it could be a valid option if you have a variety of document structures that each needs its own set of rules. You would need enough data to train your models in this case. Otherwise if you have limited document structures, very limited data (maybe none) and 100% accuracy is expected then going with rules is the obvious choice.

$\endgroup$
5
  • $\begingroup$ 100% accuracy it's a must for my task. Yes you are right, rule based system is in the AI field. What do yo mean for "very limited data (maybe none)"? $\endgroup$ – robob Dec 17 '19 at 11:11
  • 1
    $\begingroup$ data to train ML or DL models on. The size of data available plays a big role in how to approach the problem $\endgroup$ – cookiemonster Dec 17 '19 at 11:37
  • $\begingroup$ I have a lot of data to train the model, but 100% accuracy maybe is the problem. Do you have any suggestion what to use? $\endgroup$ – robob Dec 17 '19 at 13:57
  • 1
    $\begingroup$ 100% accuracy could be observed in some simple use cases of ML but even then it can't be guaranteed. it makes sense to start with a rule based system and see where the complexity and limitations are. This is usually good even if you would use ML in the end (and need to communicate to business people that 100% can't be guaranteed in this case) $\endgroup$ – cookiemonster Dec 17 '19 at 14:16
  • $\begingroup$ Yes I know that 100% accuracy it's impossibile and your advice it's a confirmation to what I thought about my needs and ML. Thanks a lot. $\endgroup$ – robob Dec 18 '19 at 7:38
3
$\begingroup$

A rule-based approach will guarantee a correct result, and it works perfectly fine. On the other hand, an AI based approach will introduce errors as AI cannot produce result with 100% accuracy, and also decreasing speed. As the document you are processing is a legal document, it would be better to use a parser as AI is only adding unnecessary wasted time and non-accurate results.

Hope I can help you.

$\endgroup$
1
  • $\begingroup$ what kind of parser do you advise? Because it's natural language I do not think that CFG parsers are goods. Maybe some regexs fit the task. $\endgroup$ – robob Jan 29 '20 at 11:29

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.