简体   繁体   中英

Understanding pattern information from messages (Command / instructions)

I am looking for understanding patterns from instructions using python and machine learning. when the information is the same. Examples:(just to understand not real ones) instruction A: Check BP every 3 hours MedA after meals 3 times daily MedB before meals 2 times daily check oxygen levels every hour Check BP every 6 hours Medx after meals 3 times daily Medy before meals 2 times daily check oxygen levels every hour B: MedA after meals 3 times daily MedB before meals 2 times daily Check BP every 3 hours check oxygen levels every hour

As seen in the above example the instructions may or may not contain certain blocks and the order may vary according to the sender. but very similar for the same sender. Using Regex is ok but needs to manually find patterns for each new sender.

I am looking for a method that can understand the previous messages. they are not language with complete grammar, just instruction.

Can anyone suggest a method better than regex?

The alternative to regex is lexical/syntax analysis. Take the sentence apart and even if you write that is is not language with grammar, it is language with some grammar. Otherwise it would be totally incomprehensible.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM