Answers.Body: <p>The question confuses ML (including DL) with AI. AI is a bigger field than ML and includes <a href="https://en.wikipedia.org/wiki/Rule-based_system" rel="nofollow noreferrer">rule-based systems</a></p>
  
  <p>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. </p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-17T11:11:19.043Z
Answers.Text: 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)"?
Answers.UserDisplayName: robob
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-17T11:37:36.307Z
Answers.Text: data to train ML or DL models on. The size of data available plays a big role in how to approach the problem
Answers.UserDisplayName: cookiemonster
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-17T13:57:10.343Z
Answers.Text: 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?
Answers.UserDisplayName: robob
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-17T14:16:26.300Z
Answers.Text: 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)
Answers.UserDisplayName: cookiemonster
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-18T07:38:54.663Z
Answers.Text: 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.
Answers.UserDisplayName: robob
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-16T18:09:55.613Z
Answers.LastActivityDate: 2019-12-16T18:09:55.613Z
Answers.UserDisplayName: cookiemonster
Answers.Body: <p>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.</p>
  
  <p>Hope I can help you.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-01-29T11:29:50.127Z
Answers.Text: 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.
Answers.UserDisplayName: robob
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-13T08:38:04.373Z
Answers.LastActivityDate: 2019-12-13T08:38:04.373Z
Answers.UserDisplayName: Clement
Body: <p>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. </p>
  
  <p>The text is a legal document, so the structure is well defined and a classic parser could do a good job.</p>
  
  <p>In the case AI could be a viable way, what would be an appropriate approach for the task?</p>
  
Tags: <machine-learning><deep-learning>
Title: Would AI be appropriate for converting unstructured text into an XML?
UserDisplayName: robob
ThreadText: # Would AI be appropriate for converting unstructured text into an XML?
  
  (Asked by: username_0 on 2019-12-13)
  
  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?
  
  **Tags:** machine-learning, deep-learning
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2019-12-16. Score: 1 | Accepted answer
  
  The question confuses ML (including DL) with AI. AI is a bigger field than ML and includes [rule-based systems](https://en.wikipedia.org/wiki/Rule-based_system)
  
  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.
  
  > **Comments:**
  > **username_0**: 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)"?  
  > **username_1**: data to train ML or DL models on. The size of data available plays a big role in how to approach the problem  
  > **username_0**: 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?  
  > **username_1**: 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)  
  > **username_0**: 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.  
  
  ---
  
  ### Answer by username_2 on 2019-12-13. Score: 3
  
  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.
  
  > **Comments:**
  > **username_0**: 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.  
  
  ---
  
  