Code Monkey home page Code Monkey logo

stng's Introduction

stng

⚠️ ChatGPT or Office 365 Copilot is going to be the solution that I wanted to achieve for this project. So this project has been moved to the archive.

stng, a sentence-transformer-based natural-language grep.

The stng is an off-the-shelf grep-like tool that performs semantic similarity search. With Sentence Transformer models, search document files that contain similar parts to query. Supports searching within text files (.txt), PDF files (.pdf), and MS Word files (.docx).

It is recommended to run this tool on a PC equipped with a GPU, as it performs calculations with PyTorch.

Installation

⚠️ stng is currently an alpha, HIGHLY EXPERIMENTAL product.

Before installing stng with pip, please install the following dependencies.

  • pdftotext (poppler)
  • pandoc
  • docopt-ng (or docopt)

Windows:

choco install vcredist140
choco install poppler
choco install pandoc
python -m pip install docopt-ng
python -m pip install stng

Mac:

brew install poppler
brew install pandoc
python3 -m pip install docopt-ng
python3 -m pip install stng

Ubuntu:

sudo apt install poppler-utils
sudo apt install pandoc
python3 -m pip install docopt-ng
python3 -m pip install stng

TL;DR (typical usage)

Search for the document files similar to the query phrase.

stng -v <query_phrase> <document_files>...

Example of search:

Links

Todo

  • Change PDF text extraction tool to GhostScript for easier installation on Windows

Release History

0.3.1

  • fix: workaround code to avoid warning on parallel execution of a tokenizer

0.3.0

  • fix: change to use a pdftotext command (instead of a library) to simplify installation

0.2.1

  • fix: some of the input files were not being read

0.2.0

  • feat: new option --quote to show paragraph of the search result instead of excerpt
  • fix: optimization in reading pdf and docx files
  • fix: option -n was renamed to option -k

0.1.1

  • fix: replace model with sentence-transformers/stsb-xlm-r-multilingual

0.1.0

  • First release

stng's People

Contributors

tos-kamiya avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.