https://github.com/simonamdev/maltese-ai-lawyer-experiment
Can we create a Maltese AI Lawyer? This is the code used for the 6th May 2024 GDG session about using LLMs and RAG to answer questions about Maltese legislation.
https://github.com/simonamdev/maltese-ai-lawyer-experiment
Last synced: about 1 year ago
JSON representation
Can we create a Maltese AI Lawyer? This is the code used for the 6th May 2024 GDG session about using LLMs and RAG to answer questions about Maltese legislation.
- Host: GitHub
- URL: https://github.com/simonamdev/maltese-ai-lawyer-experiment
- Owner: simonamdev
- License: mit
- Created: 2024-05-02T18:30:16.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-07T21:27:03.000Z (about 2 years ago)
- Last Synced: 2025-01-31T13:15:23.861Z (over 1 year ago)
- Language: Python
- Size: 6.36 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# maltese-ai-lawyer-experiment
Can we create a Maltese AI Lawyer? This is the code used for the 6th May 2024 GDG session about using LLMs and RAG to answer questions about Maltese legislation.
# Required tech
- Miniconda
- Ollama: https://github.com/ollama/ollama
# Setup
- conda create -n mal
- conda activate mal
- conda install pip
- pip install llama-index
(Note: llama-index was at 0.10.33 at time of writing)
- pip install llama-index-core llama-index-readers-file llama-index-llms-ollama llama-index-embeddings-huggingface
- ollama pull llama3:8b
- ollama pull gemma:7b
- ollama pull phi3:3.8b
- python3 test_e2e.py
# Persistence
Test and visualise embeddings generated
- pip install matplotlib
- python test_generate_embeddings.py
- python visualise_embeddings.py
# Persistence for all PDFs
- docker run --name redis-vecdb -d -p 6379:6379 -p 8001:8001 --volume ./redis_storage/:/data redis/redis-stack:latest
- pip install llama-index-vector-stores-redis redis
- python test_generate_embeddings.py
- python generate_embeddings.py
# Running the final result
- Ensure the redis docker container from above is running
- Ensure all embeddings have been generated
- python lawyer.py