| ||||||||||||||
| ||||||||||||||
|
||||||||||||||
MARS: A Virtual DoctorBy T. Harrision, J. Matthews, J. Greensmith, B. Wootton and A. Scott
This page is primarily here to explain the MARS (Medical Automated Response System) parser. All user documentation, database code and the illness database can be found in the zip file at the bottom of this page.
The MARS ParserThe MARS parser works by taking a sentence, removing all extraneous information (upper cases, punctuation etc.) and then creating a sentence tree from the words. The root of the tree is always a node that contains the complete sentence. Nodes can contain words or can denote phrases such as a noun phrase (MEWT_NP). The details of noun phrases and others can be found in the documentation. Let us look at a debug print-out for "My leg really hurts.":
Address: 0x007A8080
sWord: my leg really hurts
iType: MEWT_S (2048)
iModifier: 0
child: 0x007A9DE0
next: 0x00000000
parent: 0x00000000
Address: 0x007A9DE0
sWord: - n/a -
iType: MEWT_NP (2)
iModifier: 0
child: 0x007A8030
next: 0x007A9F50
parent: 0x007A8080
Address: 0x007A8030
sWord: my
iType: MEWT_DET (16)
iModifier: 0
child: 0x00000000
next: 0x007A9FD0
parent: 0x007A9DE0
Address: 0x007A9FD0
sWord: leg
iType: MEWT_N MEWT_DN (128)
iModifier: 19
child: 0x00000000
next: 0x00000000
parent: 0x007A9DE0
Address: 0x007A9F50
sWord: really
iType: MEWT_ADV (64)
iModifier: 1
child: 0x00000000
next: 0x007A9EC0
parent: 0x007A8080
Address: 0x007A9EC0
sWord: hurts
iType: MEWT_V (256)
iModifier: 2
child: 0x00000000
next: 0x00000000
parent: 0x007A8080
Now take a look at the query that is generated from this input:
Address: 0x007A9DA0 sSymptom: leg uLocation: ML_LEG uDuration: MD_ONEDAY uSeverity: MS_SEVERITY4 next 0x00000000Note how the location has been parsed and how "really" has modified "hurts" to produce a higher severity (MS_SEVERITY4 = 3). Let us briefly look at another example of the query system - this query structure was generated from "My left wrist is fractured.": Address: 0x007A9CE0 sSymptom: wrist uLocation: ML_HAND ML_LEFT uDuration: MD_ONEDAY uSeverity: MS_SEVERITY4 next 0x00000000Notice how the location allows for position based information (left). Also note that the word "fractured" was taken to be an indicator of severity not as a symptom. This is perhaps not the best case for all instances but it works in this scenario.
ConclusionWhile MARS is not the best diagnostic program, the code is good to learn from. Due to time constraints, the team couldn't implement all the symptom and location checks we had wanted but it does do its job relatively well (spots symptoms and other information, finds the closest match in its database and returns a result).Again, all the binaries, documentation and source code are available in the zip file below. - James Matthews (2/10/01)
Submitted: 15/05/2001 Article content copyright © T. Harrision, J. Matthews, J. Greensmith, B. Wootton and A. Scott, 2001.
|
|
|||||||||||||
All content copyright © 1998-2007, Generation5 unless otherwise noted.
- Privacy Policy - Legal - Terms of Use -