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

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:
  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

evisense-1.0.1.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

evisense-1.0.1-py3-none-any.whl (14.6 kB view details)

Uploaded Python 3

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

Hashes for evisense-1.0.1.tar.gz
Algorithm Hash digest
SHA256 5c9d9761dc55f6cd18e37d73af405752d68cfe4af24f721af6034a54b532ef74
MD5 d40960749eae1d77a585381eb008c336
BLAKE2b-256 e11c185b424c8c99d215d6e533e23e6075cb94e23901ba138cd0f95045d64c8b

See more details on using hashes here.

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

Hashes for evisense-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cf0e1be09cb4599f14ec9c69593b5762728a25aaa23c20a2471e37cd1c20b091
MD5 5396c72a261f895b785b674c7acaed5a
BLAKE2b-256 8a7386265c1d076959c851ff89dd358b0b06aadb9aabf6aac9002b0e8886345c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page