Skip to main content

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

  1. 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"
  1. 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"
  1. Directory of PDFs:
evisense-cli extract-evidence --config config.yml --source path/to/papers/ --terms "Neuron"
  1. 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:
    1. When no provider is specified
    2. When the specified provider fails to initialize
    3. When authentication fails (e.g., invalid/missing API keys)
    4. When all selected providers return errors
  • For each provider:
    • base_url: API endpoint
    • api_key: Authentication key (if required)
    • models: List of models to use
    • default_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

Release files for EviSense 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for EviSense 1.0.2
File Size Uploaded
evisense-1.0.2.tar.gz 14.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for EviSense 1.0.2
File Interpreter ABI Platform
evisense-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 28.9 kB

Release files / evisense-1.0.2.tar.gz

Download URL evisense-1.0.2.tar.gz
Size 14.0 kB
Tags Source
SHA-256 checksum
How to use checksums
3e51abba3b9387a149824f3a079879d62d07a2bae7c9edc01dbea7621ef752eb
BLAKE2b-256 checksum
How to use checksums
98c7321a4429a79a3d2d2f072656171ed87ce4997902bb37ad54add91785935b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.11.7 Darwin/23.6.0

Release files / evisense-1.0.2-py3-none-any.whl

Download URL evisense-1.0.2-py3-none-any.whl
Size 14.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0895a6e0888683642c278adde2dbd94807906dcc73a3cca35790bc83f055ab07
BLAKE2b-256 checksum
How to use checksums
78c40d62d11321b486e9decdbd4eea1984756364692a107d9df4a208ddfb9e2e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.11.7 Darwin/23.6.0

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

1.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page