Knowledge Management for Humans using Machine Learning & Tags

Overview

HyperTag

HyperTag helps humans intuitively express how they think about their files using tags and machine learning. Represent how you think using tags. Find what you look for using semantic search for your text documents (yes, even PDF's) and images. Instead of introducing proprietary file formats like other existing file organization tools, HyperTag just smoothly layers on top of your existing files without any fuss.

Objective Function: Minimize time between a thought and access to all relevant files.

Accompanying blog post: https://blog.neotree.uber.space/posts/hypertag-file-organization-made-for-humans

Table of Contents

Install

Available on PyPI

$ pip install hypertag (supports both CPU only & CUDA accelerated execution!)

Community

Join the HyperTag matrix chat room to stay up to date on the latest developments or to ask for help.

Overview

HyperTag offers a slick CLI but more importantly it creates a directory called HyperTagFS which is a file system based representation of your files and tags using symbolic links and directories.

Directory Import: Import your existing directory hierarchies using $ hypertag import path/to/directory. HyperTag converts it automatically into a tag hierarchy using metatagging.

Semantic Text & Image Search (Experimental): Search for images (jpg, png) and text documents (yes, even PDF's) content with a simple text query. Text search is powered by the awesome Sentence Transformers library. Text to image search is powered by OpenAI's CLIP model. Currently only English queries are supported.

HyperTag Daemon (Experimental): Monitors HyperTagFS and directories added to the auto import list for user changes (see section "Start HyperTag Daemon" below). Also spawns the DaemonService which speeds up semantic search significantly (warning: daemon process is a RAM hog with ~2GB usage).

Fuzzy Matching Queries: HyperTag uses fuzzy matching to minimize friction in the unlikely case of a typo.

File Type Groups: HyperTag automatically creates folders containing common files (e.g. Images: jpg, png, etc., Documents: txt, pdf, etc., Source Code: py, js, etc.), which can be found in HyperTagFS.

HyperTag Graph: Quickly get an overview of your HyperTag Graph! HyperTag visualizes the metatag graph on every change and saves it at HyperTagFS/hypertag-graph.pdf.

HyperTag Graph Example

CLI Functions

Import existing directory recursively

Import files with tags inferred from the existing directory hierarchy.

$ hypertag import path/to/directory

Add file/s or URL/s manually

$ hypertag add path/to/file https://github.com/SeanPedersen/HyperTag

Tag file/s (with values)

Manually tag files. Shortcut: $ hypertag t

$ hypertag tag humans/*.txt with human "Homo Sapiens"

Add a value to a file's tag:

$ hypertag tag sean.txt with name="Sean Pedersen"

Untag file/s

Manually remove tag/s from file/s.

$ hypertag untag humans/*.txt with human "Homo Sapiens"

Tag a tag

Metatag tag/s to create tag hierarchies. Shortcut: $ hypertag tt

$ hypertag metatag human with animal

Merge tags

Merge all associations (files & tags) of tag A into tag B.

$ hypertag merge human into "Homo Sapiens"

Query using Set Theory

Print file names of the resulting set matching the query. Queries are composed of tags (with values) and operands. Tags are fuzzy matched for convenience. Nesting is currently not supported, queries are evaluated from left to right.
Shortcut: $ hypertag q

Query with a value using a wildcard: $ hypertag query name="Sean*"
Print paths: $ hypertag query human --path
Print fuzzy matched tag: $ hypertag query man --verbose
Disable fuzzy matching: $ hypertag query human --fuzzy=0

Default operand is AND (intersection):
$ hypertag query human name="Sean*" is equivalent to $ hypertag query human and name="Sean*"

OR (union):
$ hypertag query human or "Homo Sapiens"

MINUS (difference):
$ hypertag query human minus "Homo Sapiens"

Index supported image and text files

Only indexed files can be searched.

$ hypertag index

To parse even unparseable PDF's, install tesseract: # pacman -S tesseract tesseract-data-eng

Index only image files: $ hypertag index --image
Index only text files: $ hypertag index --text

Semantic search for text files

A custom search algorithm combining semantic with token matching search. Print text file names sorted by matching score. Performance benefits greatly from running the HyperTag daemon.
Shortcut: $ hypertag s

$ hypertag search "your important text query" --path --score --top_k=10

Semantic search for image files

Print image file names sorted by matching score. Performance benefits greatly from running the HyperTag daemon.
Shortcut: $ hypertag si

Text to image: $ hypertag search_image "your image content description" --path --score --top_k=10

Image to image: $ hypertag search_image "path/to/image.jpg" --path --score --top_k=10

Start HyperTag Daemon

Start daemon process with triple functionality:

  • Watches HyperTagFS directory for user changes
    • Maps file (symlink) and directory deletions into tag / metatag removal/s
    • On directory creation: Interprets name as set theory tag query and automatically populates it with results
    • On directory creation in Search Images or Search Texts: Interprets name as semantic search query (add top_k=42 to limit result size) and automatically populates it with results
  • Watches directories on the auto import list for user changes:
    • Maps file changes (moves & renames) to DB
    • On file creation: Adds new file/s with inferred tag/s and auto-indexes it (if supported file format).
  • Spawns DaemonService to load and expose models used for semantic search, speeding it up significantly

$ hypertag daemon

Print all tags of file/s

$ hypertag tags filename1 filename2

Print all metatags of tag/s

$ hypertag metatags tag1 tag2

Print all tags

$ hypertag show

Print all files

Print names: $ hypertag show files

Print paths: $ hypertag show files --path

Visualize HyperTag Graph

Visualize the metatag graph hierarchy (saved at HyperTagFS root).

$ hypertag graph

Specify layout algorithm (default: fruchterman_reingold):

$ hypertag graph --layout=kamada_kawai

Generate HyperTagFS

Generate file system based representation of your files and tags using symbolic links and directories.

$ hypertag mount

Add directory to auto import list

Directories added to the auto import list will be monitored by the daemon for new files or changes.

$ hypertag add_auto_import_dir path/to/directory

Set HyperTagFS directory path

Default is the user's home directory.

$ hypertag set_hypertagfs_dir path/to/directory

Architecture

  • Python and it's vibrant open-source community power HyperTag
  • Many other awesome open-source projects make HyperTag possible (listed in pyproject.toml)
  • SQLite3 serves as the meta data storage engine (located at ~/.config/hypertag/hypertag.db)
  • Added URLs are saved in ~/.config/hypertag/web_pages for websites, others in ~/.config/hypertag/downloads
  • Symbolic links are used to create the HyperTagFS directory structure
  • Semantic Search: boosted using hnswlib
    • Text to text search is powered by the awesome DistilBERT
    • Text to image & image to image search is powered by OpenAI's impressive CLIP model

Development

  • Find prioritized issues here: TODO List
  • Pick an issue and comment how you plan to tackle it before starting out, to make sure no dev time is wasted.
  • Clone repo: $ git clone https://github.com/SeanPedersen/HyperTag.git
  • $ cd HyperTag/
  • Install Poetry
  • Install dependencies: $ poetry install
  • Activate virtual environment: $ poetry shell
  • Run all tests: $ pytest -v
  • Run formatter: $ black hypertag/
  • Run linter: $ flake8
  • Run type checking: $ mypy **/*.py
  • Run security checking: $ bandit --exclude tests/ -r .
  • Codacy: Dashboard
  • Run HyperTag: $ python -m hypertag

Inspiration

What is the point of HyperTag's existence?
HyperTag offers many unique features such as the import, semantic search, graphing and fuzzy matching functions that make it very convenient to use. All while HyperTag's code base staying relatively tiny at <2000 LOC compared to similar projects like TMSU (>10,000 LOC in Go) and SuperTag (>25,000 LOC in Rust), making it easy to hack on.

Owner
Ravn Tech, Inc.
Rapidly Emerging & Adapting Flock
Ravn Tech, Inc.
CodeBERT: A Pre-Trained Model for Programming and Natural Languages.

CodeBERT This repo provides the code for reproducing the experiments in CodeBERT: A Pre-Trained Model for Programming and Natural Languages. CodeBERT

Microsoft 1k Jan 03, 2023
Text to speech converter with GUI made in Python.

Text-to-speech-with-GUI Text to speech converter with GUI made in Python. To run this download the zip file and run the main file or clone this repo.

SidTheMiner 1 Nov 15, 2021
Deeply Supervised, Layer-wise Prediction-aware (DSLP) Transformer for Non-autoregressive Neural Machine Translation

Non-Autoregressive Translation with Layer-Wise Prediction and Deep Supervision Training Efficiency We show the training efficiency of our DSLP model b

Chenyang Huang 37 Jan 04, 2023
Datasets of Automatic Keyphrase Extraction

This repository contains 20 annotated datasets of Automatic Keyphrase Extraction made available by the research community. Following are the datasets and the original papers that proposed them. If yo

LIAAD - Laboratory of Artificial Intelligence and Decision Support 163 Dec 23, 2022
This repository collects together basic linguistic processing data for using dataset dumps from the Common Voice project

Common Voice Utils This repository collects together basic linguistic processing data for using dataset dumps from the Common Voice project. It aims t

Francis Tyers 40 Dec 20, 2022
CredData is a set of files including credentials in open source projects

CredData is a set of files including credentials in open source projects. CredData includes suspicious lines with manual review results and more information such as credential types for each suspicio

Samsung 19 Sep 07, 2022
A collection of Korean Text Datasets ready to use using Tensorflow-Datasets.

tfds-korean A collection of Korean Text Datasets ready to use using Tensorflow-Datasets. TensorFlow-Datasets를 이용한 한국어/한글 데이터셋 모음입니다. Dataset Catalog |

Jeong Ukjae 20 Jul 11, 2022
☀️ Measuring the accuracy of BBC weather forecasts in Honolulu, USA

Accuracy of BBC Weather forecasts for Honolulu This repository records the forecasts made by BBC Weather for the city of Honolulu, USA. Essentially, t

Max Halford 12 Oct 15, 2022
A 30000+ Chinese MRC dataset - Delta Reading Comprehension Dataset

Delta Reading Comprehension Dataset 台達閱讀理解資料集 Delta Reading Comprehension Dataset (DRCD) 屬於通用領域繁體中文機器閱讀理解資料集。 本資料集期望成為適用於遷移學習之標準中文閱讀理解資料集。 本資料集從2,108篇

272 Dec 15, 2022
AutoGluon: AutoML for Text, Image, and Tabular Data

AutoML for Text, Image, and Tabular Data AutoGluon automates machine learning tasks enabling you to easily achieve strong predictive performance in yo

Amazon Web Services - Labs 5.2k Dec 29, 2022
Auto_code_complete is a auto word-completetion program which allows you to customize it on your needs

auto_code_complete is a auto word-completetion program which allows you to customize it on your needs. the model for this program is one of the deep-learning NLP(Natural Language Process) model struc

RUO 2 Feb 22, 2022
This repository contains all the source code that is needed for the project : An Efficient Pipeline For Bloom’s Taxonomy Using Natural Language Processing and Deep Learning

Pipeline For NLP with Bloom's Taxonomy Using Improved Question Classification and Question Generation using Deep Learning This repository contains all

Rohan Mathur 9 Jul 17, 2021
InferSent sentence embeddings

InferSent InferSent is a sentence embeddings method that provides semantic representations for English sentences. It is trained on natural language in

Facebook Research 2.2k Dec 27, 2022
A Transformer Implementation that is easy to understand and customizable.

Simple Transformer I've written a series of articles on the transformer architecture and language models on Medium. This repository contains an implem

Naoki Shibuya 4 Jan 20, 2022
Mapping a variable-length sentence to a fixed-length vector using BERT model

Are you looking for X-as-service? Try the Cloud-Native Neural Search Framework for Any Kind of Data bert-as-service Using BERT model as a sentence enc

Han Xiao 11.1k Jan 01, 2023
DeeBERT: Dynamic Early Exiting for Accelerating BERT Inference

DeeBERT This is the code base for the paper DeeBERT: Dynamic Early Exiting for Accelerating BERT Inference. Code in this repository is also available

Castorini 132 Nov 14, 2022
Sentence boundary disambiguation tool for Japanese texts (日本語文境界判定器)

Bunkai Bunkai is a sentence boundary (SB) disambiguation tool for Japanese texts. Quick Start $ pip install bunkai $ echo -e '宿を予約しました♪!まだ2ヶ月も先だけど。早すぎ

Megagon Labs 160 Dec 23, 2022
Toy example of an applied ML pipeline for me to experiment with MLOps tools.

Toy Machine Learning Pipeline Table of Contents About Getting Started ML task description and evaluation procedure Dataset description Repository stru

Shreya Shankar 190 Dec 21, 2022
Revisiting Pre-trained Models for Chinese Natural Language Processing (Findings of EMNLP 2020)

This repository contains the resources in our paper "Revisiting Pre-trained Models for Chinese Natural Language Processing", which will be published i

Yiming Cui 463 Dec 30, 2022
Code repository for "It's About Time: Analog clock Reading in the Wild"

it's about time Code repository for "It's About Time: Analog clock Reading in the Wild" Packages required: pytorch (used 1.9, any reasonable version s

52 Nov 10, 2022