All Projects → johncmunson → react-taggy

johncmunson / react-taggy

Licence: other
A simple zero-dependency React component for tagging user-defined entities within a block of text.

Programming Languages

javascript
184084 projects - #8 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to react-taggy

scikitcrf NER
Python library for custom entity recognition using Sklearn CRF
Stars: ✭ 17 (-41.38%)
Mutual labels:  entities, named-entity-recognition, ner
CrossNER
CrossNER: Evaluating Cross-Domain Named Entity Recognition (AAAI-2021)
Stars: ✭ 87 (+200%)
Mutual labels:  named-entity-recognition, ner
molminer
Python library and command-line tool for extracting compounds from scientific literature. Written in Python.
Stars: ✭ 38 (+31.03%)
Mutual labels:  named-entity-recognition, ner
anonymisation
Anonymization of legal cases (Fr) based on Flair embeddings
Stars: ✭ 85 (+193.1%)
Mutual labels:  entities, ner
TweebankNLP
[LREC 2022] An off-the-shelf pre-trained Tweet NLP Toolkit (NER, tokenization, lemmatization, POS tagging, dependency parsing) + Tweebank-NER dataset
Stars: ✭ 84 (+189.66%)
Mutual labels:  named-entity-recognition, ner
SynLSTM-for-NER
Code and models for the paper titled "Better Feature Integration for Named Entity Recognition", NAACL 2021.
Stars: ✭ 26 (-10.34%)
Mutual labels:  named-entity-recognition, ner
korean ner tagging challenge
KU_NERDY 이동엽, 임희석 (2017 국어 정보 처리 시스템경진대회 금상) - 한글 및 한국어 정보처리 학술대회
Stars: ✭ 30 (+3.45%)
Mutual labels:  named-entity-recognition, ner
KoBERT-NER
NER Task with KoBERT (with Naver NLP Challenge dataset)
Stars: ✭ 76 (+162.07%)
Mutual labels:  named-entity-recognition, ner
lingvo--Ner-ru
Named entity recognition (NER) in Russian texts / Определение именованных сущностей (NER) в тексте на русском языке
Stars: ✭ 38 (+31.03%)
Mutual labels:  named-entity-recognition, ner
mitie-ruby
Named-entity recognition for Ruby
Stars: ✭ 77 (+165.52%)
Mutual labels:  named-entity-recognition, ner
deep-atrous-ner
Deep-Atrous-CNN-NER: Word level model for Named Entity Recognition
Stars: ✭ 35 (+20.69%)
Mutual labels:  named-entity-recognition, ner
NER-and-Linking-of-Ancient-and-Historic-Places
An NER tool for ancient place names based on Pleiades and Spacy.
Stars: ✭ 26 (-10.34%)
Mutual labels:  named-entity-recognition, ner
neural name tagging
Code for "Reliability-aware Dynamic Feature Composition for Name Tagging" (ACL2019)
Stars: ✭ 39 (+34.48%)
Mutual labels:  named-entity-recognition, ner
ner-d
Python module for Named Entity Recognition (NER) using natural language processing.
Stars: ✭ 14 (-51.72%)
Mutual labels:  named-entity-recognition, ner
PhoNER COVID19
COVID-19 Named Entity Recognition for Vietnamese (NAACL 2021)
Stars: ✭ 55 (+89.66%)
Mutual labels:  named-entity-recognition, ner
anonymization-api
How to build and deploy an anonymization API with FastAPI
Stars: ✭ 51 (+75.86%)
Mutual labels:  named-entity-recognition, ner
Bert ner
Ner with Bert
Stars: ✭ 240 (+727.59%)
Mutual labels:  named-entity-recognition, ner
Ner Bert Pytorch
PyTorch solution of named entity recognition task Using Google AI's pre-trained BERT model.
Stars: ✭ 249 (+758.62%)
Mutual labels:  named-entity-recognition, ner
memex-gate
General Architecture for Text Engineering
Stars: ✭ 47 (+62.07%)
Mutual labels:  entities, named-entity-recognition
simple NER
simple rule based named entity recognition
Stars: ✭ 29 (+0%)
Mutual labels:  named-entity-recognition, ner

react-taggy action shot

A simple zero-dependency React component for tagging user-defined entities within a block of text. Older brother to React Taggy Jr.

Demo

Visit the demo page and click on 'knobs' at the bottom to get a feel for how adjusting certain props effects the rendered component.

Install

npm i --save react-taggy or yarn add react-taggy

Basic Usage

ES6

import Taggy from 'react-taggy'

Node Modules

const Taggy = require('react-taggy').default

Props

  • text: (string || array) The text that will be displayed. May be a string, or an array of tokens.
  • spans: (array) The locations within the text that will get tagged. If text is a string, then start and end must be provided and refer to character indices. If text is an array of tokens, then index must be provided and refers to token index.
  • ents: (array) The allowable entity types and the color of each unique tag type. If spans contains a type that's not included in the ents array, then the color will be set to gray by default.

Example usage where text is a string

<Taggy text={text} spans={spans} ents={ents} />

const text = 'Michael Jordan ate lunch yesterday in Chicago.'

const spans = [
    {start: 0, end: 14, type: 'person'},
    {start: 25, end: 34, type: 'date'},
    {start: 38, end: 45, type: 'location'}
]

const ents = [
    {type: 'person', color: {r: 166, g: 226, b: 45}},
    {type: 'location', color: {r: 67, g: 198, b: 252}},
    {type: 'date', color: {r: 47, g: 187, b: 171}}
]

Example usage where text is an array

<Taggy text={text} spans={spans} ents={ents} />

const text = ['Michael', 'Jordan', 'ate', 'lunch', 'yesterday', 'in', 'Chicago', '.']

const spans = [
  {type: 'person', index: 0},
  {type: 'person', index: 1},
  {type: 'date', index: 4},
  {type: 'location', index: 6}
]

const ents = [
    {type: 'person', color: {r: 166, g: 226, b: 45}},
    {type: 'location', color: {r: 67, g: 198, b: 252}},
    {type: 'date', color: {r: 47, g: 187, b: 171}}
]

Contributions

All contributors will receive proper attribution, as outlined in the awesome All-Contributors specification developed by open-source superstar Kent C. Dodds.

Development Setup

This component was bootstrapped with React CDK. Please refer to React CDK documentation) to get started with the development.

Inspiration

This project is originally a fork of displacy-ent by the guys over at ExplosionAI. Now with 100% more React awesomeness!

License

react-taggy is available under BSD. See LICENSE for more details.

To-Do

  • Change the array API to to accept an array of objects that contain start and end keys, rather than a single index key. This will match the string API and will enable multi-word entities without relying on the built-in auto-aggregation.
  • The component should not fail if the ents and spans props are not provided. The text should just render like a normal <p> tag. Heck, even the text prop should be optional, and if it's not provided the component will just render like an empty <p> tag would.
  • Unit tests, snapshot tests, etc.
  • Set default color to gray if an entity is not found in the ents array.
  • Similar to the above bullet point, add option to ignore entities not found in the ents array, and just display normal text.
  • Add ability to disable auto-aggregation
  • Create a sister project where the component is just a single tag... React Taggy Jr.
  • Create a third API that accepts a single array prop that contains both tokens and entities. The example below mixes strings and objects, but an array of strictly objects would make sense as well.
[
    'The',
    'quick',
    'brown',
    {
        token: 'fox',
        type: 'animal',
        color: {r: 47, g: 187, b: 171}
    },
    'jumped',
    'over',
    'the'
    'lazy',
    {
        token: 'dog',
        type: 'animal',
        color: {r: 47, g: 187, b: 171}
    },
    '.'
]
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].