EviSense


NameEviSense JSON
Version 1.0.2 PyPI version JSON
download
home_pagehttps://github.com/sensein/EviSense
SummaryEviSense 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.
upload_time2025-02-13 19:08:15
maintainertekrajchhetri
docs_urlNone
authortekrajchhetri
requires_python<4.0,>=3.10
licenseMIT License (MIT)
keywords python knowledge graph evidence extraction language model
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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

```bash
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:
```bash
# 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"
```

2. Multiple Terms:
```bash
# 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"
```

3. Directory of PDFs:
```bash
evisense-cli extract-evidence --config config.yml --source path/to/papers/ --terms "Neuron"
```

4. Raw Text Input:
```bash
# 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

```yaml
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

```bash
git clone https://github.com/yourusername/EviSense.git
cd EviSense
pip install -e ".[dev]"
```

### Testing



## License

MIT License

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/sensein/EviSense",
    "name": "EviSense",
    "maintainer": "tekrajchhetri",
    "docs_url": null,
    "requires_python": "<4.0,>=3.10",
    "maintainer_email": "tekrajchhetri@gmail.com",
    "keywords": "python, knowledge graph, evidence extraction, language model",
    "author": "tekrajchhetri",
    "author_email": "tekrajchhetri@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/98/c7/321a4429a79a3d2d2f072656171ed87ce4997902bb37ad54add91785935b/evisense-1.0.2.tar.gz",
    "platform": null,
    "description": "# EviSense\n\nEviSense 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.\n\n\n## Features\n\n- Extract evidence and rationale from PDF documents, raw text, and directories\n- Support for multiple LLM providers, including Ollama and OpenRouter and multiple models\n- Flexible term search \u2013 retrieve insights for single or multiple terms efficiently\n\n## Installation\n\n```bash\npip install evisense\n```\n## Requirements\n- Since it uses GrobidArticleExtractor, you must have Grobid running either locally or provide the remote Grobid Server url.\n\n## Usage\n\n### Input Types\n\n1. PDF Files:\n```bash\n# Using absolute path\nevisense-cli extract-evidence --config config.yml --source /full/path/to/paper.pdf --terms \"Neuron\"\n\n# Using relative path (relative to current directory)\nevisense-cli extract-evidence --config config.yml --source documents/paper.pdf --terms \"Neuron\"\n```\n\n2. Multiple Terms:\n```bash\n# Using JSON array\nevisense-cli extract-evidence --config config.yml --source paper.pdf --terms '[\"Astrocyte\",\"Ependymal\"]'\n\n# Using comma-separated values\nevisense-cli extract-evidence --config config.yml --source paper.pdf --terms \"Astrocyte,Ependymal\"\n```\n\n3. Directory of PDFs:\n```bash\nevisense-cli extract-evidence --config config.yml --source path/to/papers/ --terms \"Neuron\"\n```\n\n4. Raw Text Input:\n```bash\n# Short text\nevisense-cli extract-evidence --config config.yml --source \"This is a neuroscience text...\" --terms \"Neuron\"\n```\n\n### Configuration Options\n\n- `provider`: (Optional) Specifies which provider to use (\"all\" or specific provider name)\n- `default`: Default provider to use in these scenarios:\n  1. When no provider is specified\n  2. When the specified provider fails to initialize\n  3. When authentication fails (e.g., invalid/missing API keys)\n  4. When all selected providers return errors\n- For each provider:\n  - `base_url`: API endpoint\n  - `api_key`: Authentication key (if required)\n  - `models`: List of models to use\n  - `default_model`: Default model if no specific models listed\n\n### Example Configuration\n\n```yaml\nllm:\n  default: \"ollama\"  # Specifies the default LLM provider\n  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\n\n  ollama:\n    base_url: \"http://localhost:11434\"\n    default_model: \"deepseek-r1:14b\"  # Default model for Ollama\n    models:\n      - \"deepseek-r1:14b\"\n      - \"qwen2.5-coder:14b\"\n\n  openrouter:\n    api_key: \"sk-or-v1\"\n    base_url: \"https://openrouter.ai/api/v1\"\n    default_model: \"gpt-4\"  # Default model for OpenRouter\n    models:\n      - \"gpt-4\"\n      - \"gpt-4-turbo\"\n\n  grobid_server_url: \"http://localhost:8070\" #optional, if not specified, uses the default one http://http://localhost:8070\n\n```\n\n\n## Development\n\n### Setup\n\n```bash\ngit clone https://github.com/yourusername/EviSense.git\ncd EviSense\npip install -e \".[dev]\"\n```\n\n### Testing\n\n\n\n## License\n\nMIT License\n",
    "bugtrack_url": null,
    "license": "MIT License (MIT)",
    "summary": "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.",
    "version": "1.0.2",
    "project_urls": {
        "Documentation": "https://tekrajchhetri.github.io/EviSense",
        "Homepage": "https://github.com/sensein/EviSense",
        "Repository": "https://github.com/sensein/EviSense"
    },
    "split_keywords": [
        "python",
        " knowledge graph",
        " evidence extraction",
        " language model"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "78c40d62d11321b486e9decdbd4eea1984756364692a107d9df4a208ddfb9e2e",
                "md5": "31c03838bff3df2f61e3cc549e10c901",
                "sha256": "0895a6e0888683642c278adde2dbd94807906dcc73a3cca35790bc83f055ab07"
            },
            "downloads": -1,
            "filename": "evisense-1.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "31c03838bff3df2f61e3cc549e10c901",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 14835,
            "upload_time": "2025-02-13T19:08:12",
            "upload_time_iso_8601": "2025-02-13T19:08:12.571339Z",
            "url": "https://files.pythonhosted.org/packages/78/c4/0d62d11321b486e9decdbd4eea1984756364692a107d9df4a208ddfb9e2e/evisense-1.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "98c7321a4429a79a3d2d2f072656171ed87ce4997902bb37ad54add91785935b",
                "md5": "adb55c9fa1d93cf6ad61592ca38c7d7e",
                "sha256": "3e51abba3b9387a149824f3a079879d62d07a2bae7c9edc01dbea7621ef752eb"
            },
            "downloads": -1,
            "filename": "evisense-1.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "adb55c9fa1d93cf6ad61592ca38c7d7e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 14036,
            "upload_time": "2025-02-13T19:08:15",
            "upload_time_iso_8601": "2025-02-13T19:08:15.326435Z",
            "url": "https://files.pythonhosted.org/packages/98/c7/321a4429a79a3d2d2f072656171ed87ce4997902bb37ad54add91785935b/evisense-1.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-02-13 19:08:15",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "sensein",
    "github_project": "EviSense",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "evisense"
}
        
Elapsed time: 0.47389s