Skip to main content

A library for semantic search in local environment

Project description

Forcolate Library

Build status Docs status Version Python Version Downloads License

Explore FORcolate docs »

AI search is like a box of FORcolates. You never know what you're gonna get.

Forcolate is a versatile library designed to enhance semantic search capabilities, in particular in a setting where it is deployed locally (and not in a cloud environment). It offers a suite of tools that facilitate efficient and intelligent search functionalities, making it easier to find relevant information within large datasets.

Features

  • Bullet Point Workflow: Process text messages containing bullet points, where each bullet point is handled using a selected tool.
  • Semantic Search for Documents: Search for files and documents within local directories using advanced semantic search algorithms.
  • Semantic Search for Outlook Emails: Perform semantic search on Microsoft Outlook emails using the Win32 API.
  • Convert Documents to Text: Convert documents from various formats (e.g., PDF, Word) into plain text for easier processing.
  • Summarize Documents: Generate summaries for individual documents within a specified directory.
  • Summarize Folder: Create a single cohesive summary from the contents of all files in a folder.
  • Download URL to Text: Fetch and convert web pages or documents from URLs into plain text.

Installation

To install the Forcolate library, use the following command:

pip install forcolate

Usage

Most of the functions are constructed around a key principle : sequence of working folders Each function take as parameters a query, an input folder and an output folder.

  • For search function, the search adds new files to the output and copy all (relevant) files from the input folder
  • For transformation function (such as summary), the transformation is applied on all files of the input and produce different files in the output

The query in itseld can contain rich informations such as other folders path to take as input.

Bullet Point Workflow

The Forcolate library includes a workflow for processing text messages containing bullet points. Each bullet point is processed using a selected tool. Below is an example of how to use this workflow:

from forcolate.bullet_point_workflow import run_bullet_point_workflow

text_message = """
- Search for documents in the folder
- Summarize the documents
- Convert URLs to text
"""
memory_folder = "path/to/memory/folder" # This folder will contain one folder per step

# Run the workflow
for progress in run_bullet_point_workflow(text_message, memory_folder):
    print(f"Step {progress['step']} of {progress['total_steps']}: {progress['message']}")

Semantic Search for Outlook Emails

This tool performs semantic search on Outlook emails using the Win32 API. Below is an example of how to use this tool:

from forcolate import search_outlook_emails

query = "Search emails for 'project updates' "
folder_in = "path/to/input/folder" # all the content will be copied in output
folder_out = "path/to/output/folder"

file_paths = search_outlook_emails(query, folder_in, folder_out)
print(file_paths)

Semantic Search for Documents

This tool searches for documents in a folder (and recursively in subfolder and compressed files) using a semantic search model. Below is an example of how to use this tool:

from forcolate import search_folder

query = "Search for 'financial reports' in path/to/source/directory"
folder_in = "path/to/input/folder" # this folder will also be search in
folder_out = "path/to/output/folder"

file_paths = search_folder(query, folder_in, folder_out)
print(file_paths)

Convert Documents to Text

This tool converts documents from various formats into plain text. Below is an example of how to use this tool:

from forcolate import convert_folders_to_markdown

query = "Convert documents in path/to/source/directory to text"
folder_in = "path/to/input/folder"
folder_out = "path/to/output/folder"

convert_folders_to_markdown(query, folder_in, folder_out)

Summarize Documents

This tool summarizes the content of each individual document within a specified directory. Below is an example of how to use this tool:

from forcolate import summarize_documents

query = "" # Not used at the moment
folder_in = "path/to/input/folder"
folder_out = "path/to/output/folder"

summarize_documents(query, folder_in, folder_out)

Summarize Folder

This tool generates a single summary from all the information in a folder. Below is an example of how to use this tool:

from forcolate import summarize_folder

query = "Summarize all files in path/to/source/directory"
folder_in = "path/to/input/folder"
folder_out = "path/to/output/folder"

summarize_folder(query, folder_in, folder_out)

Download URL to Text

This tool downloads a document or web page from the internet and converts the content into plain text. Below is an example of how to use this tool:

from forcolate import convert_URLS_to_markdown

query = "Download and convert https://example.com/document1 and https://example.com/document2"
folder_in = "path/to/input/folder" # This folder will be copied
folder_out = "path/to/output/folder"

convert_URLS_to_markdown(query, folder_in, folder_out)

Contributing

Contributions to the Forcolate library are welcome! If you have ideas for new features, improvements, or bug fixes, please open an issue or submit a pull request.

Acknowledgement

This project received funding from the French ”IA Cluster” program within the Artificial and Natural Intelligence Toulouse Institute (ANITI) and from the "France 2030" program within IRT Saint Exupery. The authors gratefully acknowledge the support of the FOR projects.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

forcolate-0.1.17.tar.gz (127.8 kB view details)

Uploaded Source

Built Distribution

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

forcolate-0.1.17-py3-none-any.whl (130.7 kB view details)

Uploaded Python 3

File details

Details for the file forcolate-0.1.17.tar.gz.

File metadata

  • Download URL: forcolate-0.1.17.tar.gz
  • Upload date:
  • Size: 127.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for forcolate-0.1.17.tar.gz
Algorithm Hash digest
SHA256 67c73326ff6a2892f17ae6fd638e99318e9e020d75b7a27e1e065e7f0caad439
MD5 3680c903931c3f4e9486b11c53fa6142
BLAKE2b-256 a949349f004646e1bc11ae543274aece691cfebea29cd31aeae126f33961a875

See more details on using hashes here.

Provenance

The following attestation bundles were made for forcolate-0.1.17.tar.gz:

Publisher: publish.yml on FOR-sight-ai/FORcolate

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file forcolate-0.1.17-py3-none-any.whl.

File metadata

  • Download URL: forcolate-0.1.17-py3-none-any.whl
  • Upload date:
  • Size: 130.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for forcolate-0.1.17-py3-none-any.whl
Algorithm Hash digest
SHA256 b0e5e10748cd7bb1d540e7c03d49c2ec18bd770fab30cd8b6d1b93a398444d1f
MD5 9b2e50447b1d9e151609b80426d6a7e6
BLAKE2b-256 15d8421b3cceb179fecb2da5a786ad2698375562b98e37f192a0d0226251f6b2

See more details on using hashes here.

Provenance

The following attestation bundles were made for forcolate-0.1.17-py3-none-any.whl:

Publisher: publish.yml on FOR-sight-ai/FORcolate

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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