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.
Project description
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
Requirements
- Since it uses GrobidArticleExtractor, you must have Grobid running either locally or provide the remote Grobid Server url.
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:
default: "ollama" # Specifies the default LLM provider
provider: "openrouter" #select provider to use, e.g., ollama or openrouter. the value all will make use of all the providers specified in config in current case ollama and openrouter
ollama:
base_url: "http://localhost:11434"
default_model: "deepseek-r1:14b" # Default model for Ollama
models:
- "deepseek-r1:14b"
- "qwen2.5-coder:14b"
openrouter:
api_key: "sk-or-v1"
base_url: "https://openrouter.ai/api/v1"
default_model: "gpt-4" # Default model for OpenRouter
models:
- "gpt-4"
- "gpt-4-turbo"
grobid_server_url: "http://localhost:8070" #optional, if not specified, uses the default one http://http://localhost:8070
Development
Setup
git clone https://github.com/yourusername/EviSense.git
cd EviSense
pip install -e ".[dev]"
Testing
License
MIT License
Project details
Release history Release notifications | RSS feed
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
File details
Details for the file evisense-1.0.2.tar.gz
.
File metadata
- Download URL: evisense-1.0.2.tar.gz
- Upload date:
- Size: 14.0 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 | 3e51abba3b9387a149824f3a079879d62d07a2bae7c9edc01dbea7621ef752eb |
|
MD5 | adb55c9fa1d93cf6ad61592ca38c7d7e |
|
BLAKE2b-256 | 98c7321a4429a79a3d2d2f072656171ed87ce4997902bb37ad54add91785935b |
File details
Details for the file evisense-1.0.2-py3-none-any.whl
.
File metadata
- Download URL: evisense-1.0.2-py3-none-any.whl
- Upload date:
- Size: 14.8 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 | 0895a6e0888683642c278adde2dbd94807906dcc73a3cca35790bc83f055ab07 |
|
MD5 | 31c03838bff3df2f61e3cc549e10c901 |
|
BLAKE2b-256 | 78c40d62d11321b486e9decdbd4eea1984756364692a107d9df4a208ddfb9e2e |