Giter Club home page Giter Club logo

gazetteer-rs's Introduction

gazetteer-rs

Rust implemenatation of a skip-gram gazetteer tagger

version build latest

Description

This project can be used to find large numbers of search terms in documents in linear time with respect to the document length.

Process

Generally, the process is as follows.

  1. Given an input tab-separated list of search-term-label-pairs, will construct a search tree of words.
  2. Then, for each document, iterate over the words in the document and traverse the tree if a matching word is found.

Details

To create the tree, the input lists are segmented using a pre-tokenizer from the tokenizers library.

The tree is backed by Rusts standard library HashMap.

The RESTful interface is implemented using rocket.

There are configuration options to enable the abbrevation of search terms or the creation of n-grams from search term segments, see config.toml.

Tree Properties

It is important to note, that multiple occurrences of search terms in the input data will result in multiple labels on the leafs of the search tree. This is especially true if n-grams are generated. Each resulting match is returned alongside its match type, which may either be MatchType::Full, MatchType::Abbreviated or MatchType::NGram.

See below for an example tree given the input:

Puffinus          https://www.gbif.org/species/5229335
Puffinus puffinus https://www.gbif.org/species/5229380
Sula              https://www.gbif.org/species/2480966
Sula bassana      https://www.gbif.org/species/4352320
Sula leucogaster  https://www.gbif.org/species/2480975

Example Tree Here, the orange nodes represent nodes within the search tree and purple nodes represent Full type matches with their corresponding labels.

See below for a small tree given the following list, with n-grams enabled:

Sula                          https://www.gbif.org/species/2480966
Sula bassana                  https://www.gbif.org/species/4352320
Sula leucogaster              https://www.gbif.org/species/2480975
Sula leucogaster leucogaster  https://www.gbif.org/species/7192777

Here, the light green node represents a NGram type match.

TextImager 2.0 Interface

Supports the new TextImager interface v1. See:

GUI

You can also build the tool with --features gui to enable an additional user interface that allows tagging small texts or uploading small plaintext files for tagging. This requires an additional dependency: rocket_dyn_templates

Screenshots

Screenshot of the GUI

The GUI.

Screenshot of the Results

The output of the GUI is human-readable.

Note

  • This project is currently still a work-in-progress.
  • See biofid-gazetteer for a Java implementation of a similar tool that integrates with the TextImager pipeline.

gazetteer-rs's People

Contributors

m-stoeckel avatar

Watchers

 avatar

Forkers

m-stoeckel

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.