EviSense
EviSense is a Python library developed as a part of BrainKB project designed to extract evidence and rationales for specific terms within documents, including scientific publications. It enables efficient retrieval of relevant information from various sources, supporting multiple LLM providers and concurrent processing.
Features
- Extract evidence and rationale from PDF documents, raw text, and directories
- Support for multiple LLM providers, including Ollama and OpenRouter and multiple models
- Flexible term search – retrieve insights for single or multiple terms efficiently
Installation
pip install evisense
Usage
Input Types
- PDF Files:
# Using absolute path
evisense-cli extract-evidence --config config.yml --source /full/path/to/paper.pdf --terms "Neuron"
# Using relative path (relative to current directory)
evisense-cli extract-evidence --config config.yml --source documents/paper.pdf --terms "Neuron"
- Multiple Terms:
# Using JSON array
evisense-cli extract-evidence --config config.yml --source paper.pdf --terms '["Astrocyte","Ependymal"]'
# Using comma-separated values
evisense-cli extract-evidence --config config.yml --source paper.pdf --terms "Astrocyte,Ependymal"
- Directory of PDFs:
evisense-cli extract-evidence --config config.yml --source path/to/papers/ --terms "Neuron"
- Raw Text Input:
# Short text
evisense-cli extract-evidence --config config.yml --source "This is a neuroscience text..." --terms "Neuron"
Configuration Options
provider: (Optional) Specifies which provider to use ("all" or specific provider name)default: Default provider to use in these scenarios:- When no provider is specified
- When the specified provider fails to initialize
- When authentication fails (e.g., invalid/missing API keys)
- When all selected providers return errors
- For each provider:
base_url: API endpointapi_key: Authentication key (if required)models: List of models to usedefault_model: Default model if no specific models listed
Example Configuration
llm:
provider: "openrouter" # Try OpenRouter first
default: "ollama" # Use Ollama if OpenRouter auth fails
openrouter:
api_key: "your-key" # If this key is invalid...
base_url: "https://openrouter.ai/api/v1"
models:
- "gpt-4"
ollama: # ...system will fall back to Ollama
base_url: "http://localhost:11434"
default_model: "deepseek-r1:14b"
Development
Setup
git clone https://github.com/yourusername/EviSense.git
cd EviSense
pip install -e ".[dev]"
Testing
License
MIT License
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file evisense-1.0.1.tar.gz.
File metadata
- Download URL: evisense-1.0.1.tar.gz
- Upload date:
- Size: 13.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
poetry/1.8.3 CPython/3.11.7 Darwin/23.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5c9d9761dc55f6cd18e37d73af405752d68cfe4af24f721af6034a54b532ef74
|
|
| MD5 |
d40960749eae1d77a585381eb008c336
|
|
| BLAKE2b-256 |
e11c185b424c8c99d215d6e533e23e6075cb94e23901ba138cd0f95045d64c8b
|
File details
Details for the file evisense-1.0.1-py3-none-any.whl.
File metadata
- Download URL: evisense-1.0.1-py3-none-any.whl
- Upload date:
- Size: 14.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
poetry/1.8.3 CPython/3.11.7 Darwin/23.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cf0e1be09cb4599f14ec9c69593b5762728a25aaa23c20a2471e37cd1c20b091
|
|
| MD5 |
5396c72a261f895b785b674c7acaed5a
|
|
| BLAKE2b-256 |
8a7386265c1d076959c851ff89dd358b0b06aadb9aabf6aac9002b0e8886345c
|