Spaces:
Sleeping
Sleeping
Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,130 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
title: Ontograph
|
3 |
emoji: π»
|
@@ -9,4 +136,3 @@ app_file: app.py
|
|
9 |
pinned: false
|
10 |
---
|
11 |
|
12 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
1 |
+
# π OntoGraph - Drug Interaction Analysis System
|
2 |
+
|
3 |
+
A sophisticated Python-based application that combines ontology reasoning with LLM capabilities to analyze drug interactions, conflicts, and alternatives. The system provides comprehensive analysis through both CLI and web interfaces.
|
4 |
+

|
5 |
+
|
6 |
+
## π Key Features
|
7 |
+
|
8 |
+
- Dual Interface Options:
|
9 |
+
- Web-based interface using Streamlit
|
10 |
+
- Command-line interface for direct interaction
|
11 |
+
- Comprehensive Drug Analysis:
|
12 |
+
- Drug interaction detection
|
13 |
+
- Conflict identification
|
14 |
+
- Similar drug suggestions
|
15 |
+
- Alternative medication recommendations
|
16 |
+
- Advanced Technology Stack:
|
17 |
+
- RDF/OWL ontology for knowledge representation
|
18 |
+
- Groq LLM integration for natural language processing
|
19 |
+
- Agent-based architecture using Langgraph for modular analysis
|
20 |
+
- Structured logging system
|
21 |
+
|
22 |
+
## π οΈ Technical Requirements
|
23 |
+
|
24 |
+
- Python 3.x
|
25 |
+
- Groq API key
|
26 |
+
- Required Python packages:
|
27 |
+
- rdflib
|
28 |
+
- langchain
|
29 |
+
- python-dotenv
|
30 |
+
- langchain-community
|
31 |
+
- langchain-groq
|
32 |
+
- langgraph
|
33 |
+
- streamlit
|
34 |
+
|
35 |
+
## π₯ Installation
|
36 |
+
|
37 |
+
1. Clone the repository:
|
38 |
+
```bash
|
39 |
+
git clone https://github.com/Manithj/onto_graph.git
|
40 |
+
cd onto_graph
|
41 |
+
```
|
42 |
+
|
43 |
+
2. Install dependencies:
|
44 |
+
```bash
|
45 |
+
pip install -r requirements.txt
|
46 |
+
```
|
47 |
+
|
48 |
+
3. Configure environment:
|
49 |
+
- Create a `.env` file in the project root
|
50 |
+
- Add your Groq API key:
|
51 |
+
```bash
|
52 |
+
GROQ_API_KEY=your_api_key_here
|
53 |
+
```
|
54 |
+
|
55 |
+
## π» Usage
|
56 |
+
|
57 |
+
### Web Interface
|
58 |
+
```bash
|
59 |
+
streamlit run app.py
|
60 |
+
```
|
61 |
+
Navigate to the displayed local URL to access the web interface.
|
62 |
+
|
63 |
+
### Command Line Interface
|
64 |
+
```bash
|
65 |
+
python appcli.py
|
66 |
+
```
|
67 |
+
|
68 |
+
## ποΈ Project Structure
|
69 |
+
|
70 |
+
```
|
71 |
+
onto_graph/
|
72 |
+
βββ app.py # Streamlit web interface
|
73 |
+
βββ appcli.py # Command line interface
|
74 |
+
βββ agents/ # Agent implementations
|
75 |
+
β βββ __init__.py
|
76 |
+
β βββ alternative_agent.py
|
77 |
+
β βββ base_agent.py
|
78 |
+
β βββ conflict_agent.py
|
79 |
+
β βββ interaction_agent.py
|
80 |
+
β βββ similarity_agent.py
|
81 |
+
βββ analyzers/ # Analysis coordination
|
82 |
+
β βββ __init__.py
|
83 |
+
β βββ drug_interaction_analyzer.py
|
84 |
+
βββ ontology/ # Knowledge base
|
85 |
+
β βββ DrugInteraction.owl
|
86 |
+
βββ requirements.txt # Project dependencies
|
87 |
+
```
|
88 |
+
|
89 |
+
## π Features in Detail
|
90 |
+
|
91 |
+
### Agent System
|
92 |
+
- **Base Agent**: Common functionality for ontology queries
|
93 |
+
- **Alternative Agent**: Identifies alternative medications
|
94 |
+
- **Similarity Agent**: Finds similar drugs
|
95 |
+
- **Conflict Agent**: Detects drug conflicts
|
96 |
+
- **Interaction Agent**: Analyzes drug interactions
|
97 |
+
|
98 |
+
### Analysis Pipeline
|
99 |
+
1. User input processing
|
100 |
+
2. Ontology querying
|
101 |
+
3. LLM-powered result synthesis
|
102 |
+
4. Structured response generation
|
103 |
+
|
104 |
+
## π€ Contributing
|
105 |
+
|
106 |
+
We welcome contributions! Please follow these steps:
|
107 |
+
|
108 |
+
1. Fork the repository
|
109 |
+
2. Create a feature branch
|
110 |
+
3. Commit your changes
|
111 |
+
4. Push to your branch
|
112 |
+
5. Create a Pull Request
|
113 |
+
|
114 |
+
## π Logging
|
115 |
+
|
116 |
+
The system maintains detailed logs in `app.log`, capturing:
|
117 |
+
- Information level messages
|
118 |
+
- Warning and error states
|
119 |
+
- Query execution details
|
120 |
+
- System state changes
|
121 |
+
|
122 |
+
## π License
|
123 |
+
|
124 |
+
This project is licensed under the [Apache 2.0](LICENSE).
|
125 |
+
|
126 |
+
## Huggingface Configurations
|
127 |
+
|
128 |
---
|
129 |
title: Ontograph
|
130 |
emoji: π»
|
|
|
136 |
pinned: false
|
137 |
---
|
138 |
|
|