Building a ‘smart’ medical chatbot: a conversational recommender for diagnosis using fuzzy rules
We designed a conversational AI for medical diagnosis that doesn’t just match keywords. It uses fuzzy logic and formal concept analysis to have an intelligent dialogue, understand uncertain symptoms, and guide a user to a diagnosis.
When you feel sick, you don’t just state a list of facts. You say things like, “I have a slight fever” or “my headache is moderate.” The real world is full of this “fuzzy,” imprecise information. So why don’t computers understand it?
In our 2020 paper published in Expert Systems with Applications (Q1), we tackled this problem. We built a system designed not just to give answers, but to have an intelligent conversation about medical diagnosis.
🧐 The problem: diagnosis is a dialogue, not a search
Most simple medical “checkers” are just search engines. You type in “cough and fever,” and they give you a list of possible diseases.
But a real diagnosis isn’t a one-off query. It’s a back-and-forth conversation. A doctor asks follow-up questions, and you critique their suggestions (“No, it’s not a sharp pain, it’s a dull ache”). This dialogue, filled with fuzzy descriptions, is what allows an expert to narrow down the possibilities. We wanted to build a system that could do the same.
💡 Our solution: a chatbot that thinks with fuzzy logic
We designed a conversational recommender system that uses Fuzzy Formal Concept Analysis (FCA) as its knowledge base.
Instead of just storing data, our system stores knowledge in the form of fuzzy rules (graded implications). These are logical rules that can handle uncertainty, for example:
if fever is 'high' AND cough is 'persistent' THEN flu_likelihood is 'high'if headache is 'moderate' AND fatigue is 'low' THEN flu_likelihood is 'low'
The system’s “brain” is an automated reasoning engine built on fuzzy simplification logic. This allows it to understand your fuzzy inputs (like “slight fever”) and logically combine all the rules to make an intelligent suggestion.
🛠️ How it works: the dialogue flow
The system doesn’t just give you an answer. It guides you through a conversation, just like a doctor.
- You start with a symptom (e.g., “I have a headache”).
- The system uses its fuzzy rules to make an initial recommendation (e.g., “It might be a migraine. Do you also have sensitivity to light?”).
- You critique this (“Yes, a little bit,” or “No, not at all”).
- The system takes this new information, re-runs its logic engine, and refines its recommendation.
This loop continues, narrowing down the possibilities in a natural, human-like dialogue.
🔬 Why does this matter?
This work is a step towards more intelligent and useful telemedicine. By building a system that can understand the nuance and uncertainty of human language, we can create tools that are genuinely helpful.
Instead of a “Dr. Google” that just scares you with a list of possibilities, this approach leads to a “virtual medical assistant” that can have a sensible conversation, ask the right follow-up questions, and provide more reliable guidance.
📖 The full paper
For the complete architecture of the system, the details on the fuzzy simplification logic engine, and the formal proofs, you can read the full journal article.
A conversational recommender system for diagnosis using fuzzy rules. Authors: Pablo Cordero, Manuel Enciso, Domingo López-Rodríguez, Ángel Mora. Journal: Expert Systems with Applications (vol. 154, 113449)