A labeler component that Lays out text and overlays textual decorations like labels, predictions, and relations based on given data and handles user interactions on tokens.

Overview

react-text-annotator

react-text-annotator is a labeler component that:

  • Lays out text and overlays textual decorations like labels, predictions, and relations based on given data.
  • Handles user interactions on tokens.
  • Is extensible to allow for custom rendering of tokens and decoration overlays.
  • Is accessible to use with full keyboard interactions.

This labeler is character tokenized, meaning that it will break all text sent in its props to character level tokens. Tokens are split to lines based on line breaks in the original text and the maximum number of characters allowed in each line. The labeler also ensures that contiguous words in the original text are not split across multiple lines.

Examples

Here are some example of how to use the labeler component:

    const annotations: AnnotationData[] = [
        {
            id: 'id1',
            color: 'red',
            endToken: 15,
            startToken: 5,
            name: 'label',
            kind: 'label'
        },
        {
            id: 'id2',
            color: 'blue',
            endToken: 25,
            startToken: 10,
            name: 'relation',
            kind: 'relation'
        }
    ];

    const labelerText = 'This is sample text to test the labeler functionality.';

    return <Labeler text={labelerText} annotations={annotations} />;

the result is:

result-1


 const annotations: AnnotationData[] = [
        {
            id: 'id1',
            color: 'red',
            endToken: 15,
            startToken: 2,
            name: 'label',
            kind: 'label'
        }
    ];

    const labelerText = `اسمي محمد و اعمل لدى شركة ميكروسوفت`;

    return <Labeler text={labelerText} annotations={annotations} labelerConfigs={{ isRtl: true, tokenizationType: 'word' }} />;

the result is:

result-2

You might also like...

A Vue.js popover component based on PopperJS

vue3-popper A popover component for Vue 3 Documentation Check out the documentation Getting started Usage Install NPM npm install vue3-popper Yarn yar

Dec 30, 2022

Collection of Animated 60 FPS TabBar Component's based on React Navigation.

Collection of Animated 60 FPS TabBar Component's based on React Navigation.

React Navigation TabBar Collection Collection of Animated 60 FPS TabBar Components based on React Navigation. Features 60 FPS Animation Beautiful TabB

Dec 9, 2022

A component library based on Material Design 3 & Web Components

material-web-entity Material Web Entity A component library based on Material Design & Web Components Go to link to see what components this library s

Jun 3, 2022

Income Expense Tracker is a user based income-expense tracking system featuring budget planning and statistical analysis.

Income-Expense-Tracker Features Income Expense Tracker is a user based income-expense tracking system featuring budget planning and statistical analys

Oct 6, 2022

🔄 Basic project to start studying React and Typescript. With it you can translate text to binary or morse language. This project addresses the creation of routes and components.

max-conversion Projeto criado para iniciar nos estudos de React e Typescript Basic project to gain knowledge in react Na plataforma é possível convert

Feb 12, 2022

A text editor built with react , firebase and quill

Welcome to Text-Editor 👋 A simple text editor built with react,firebase v8 & quill ✨ Demo Install npm install Usage npm run start Run tests npm run t

Aug 30, 2022

PDF-to-TEXT using Rest7 API REACT-NATIVE

PDF-to-TEXT using Rest7 API REACT-NATIVE

PDF-to-TEXT-using-Rest7-API-REACT-NATIVE- I have made a Demo App to select PDF from documents and convert it into text than Display in ( component) us

Nov 22, 2022

Material-UI is a simple and customizable component library to build faster, beautiful, and more accessible React applications. Follow your own design system, or start with Material Design.

Material-UI is a simple and customizable component library to build faster, beautiful, and more accessible React applications. Follow your own design system, or start with Material Design.

Material-UI Quickly build beautiful React apps. Material-UI is a simple and customizable component library to build faster, beautiful, and more access

Dec 30, 2022

This hook allows you to isolate and manage the state within the component, reducing rendering operations and keeping the source code concise.

React Hook Component State This hook allows you to isolate and manage the state within the component, reducing rendering operations and keeping the so

May 15, 2022
Comments
  • Todo items for labeler

    Todo items for labeler

    Some todo items! :)

    High priority items

    • Thorough documentation on the configuration props the labeler exposes.
    • Thorough documentation on how to extend the labeler renderers and tokenizers with examples.
    • Host a small app service containing a well designed demo page with example labeler usages.
      • With each example, add a short snippet of the code that enabled it to be.
      • Examples can be:
        • Happy scenario; English text with some labels, predictions, and relations.
        • Full document with labels, predictions and with virtualization enabled.
        • Showcase language support: Character tokenized languages (Ex: CJK) and RTL (Ex: Arabic)
        • Showcase rendering extensibility capabilities:
    • The docs folder should be on the top level of the repo.
    • The ReadMe file should organize the docs, many developers are interested in the architecture of tools.
      • You can even create a GitHub IO page for the labeler in the future 😍

    Medium priority items:

    • There is a luisAppSettings.js file. How is that relevant to the labeler? It contains configs for language services. It should be removed? If it is there for reason, I recommend a more generic name relevant to the labeler.
    • The setupJest file contains configs that are not relevant to the labeler. Please remove them, ensuring only those for the labeler tests are included.
    • Is the public folder there on purpose? If it is not, remove it.
      • If it is, it is actually a good idea to add code for a small app that users can run locally if they download the repo or fork it. Make sure this small app is excluded from the NPM package that gets installed though.
    opened by omarsourour 1
Owner
Microsoft
Open source projects and samples from Microsoft
Microsoft
A small component based app library composing user interfaces and apps.

See https://vibejs.com for ongoing documentation and info. VibeJS A small component based JavaScript library to build user interfaces and apps. If you

Bret 20 Nov 16, 2022
TV Show App is an application that allows to searh tv shows based on user input. Each tv show is displayed in a Bulma Card component and when clicked, heads you to the official tv show site

TV SHOW APP TV Show App is an application that allows to search tv shows based on user input. Each tv show is displayed in a Bulma* Card component and

HENDEL SAMY 1 Dec 19, 2021
Set of property utilities for Stitches with theme tokens support. Use the built-in utils, or easily build custom ones.

Stitches Mix Set of property utilities for Stitches with theme tokens support. Use the built-in utils, or easily build custom ones. Usage To import al

João Pedro Schmitz 12 Aug 8, 2022
As a user, I want to be able to post about travel locations and provide comments and ratings. As a user, I want to be able to look at other users posts and search travel locations by rating.

Travel-bug https://travelbug-project.herokuapp.com/ Table of Contents User-Story Description Installation Usage Contributions Tests License Questions

Megan 3 Mar 2, 2022
A bookstore app that allows a user add a book, displays added book with reviews and rating for each book and allows a user delete a book.

BOOKSTORE A bookstore app that allows a user add a book, displays added book with reviews and rating for each book and allows a user delete a book. Bu

Promise Okechukwu 7 Nov 1, 2022
A simple and responsive quizlet-like flashcard component with a few additional options

Welcome to react-quizlet-flashcard ?? A simple and responsive quizlet-like flashcard component with a few additional options. Front and back card acce

A.B.Santhosh 14 Dec 17, 2022
Light-weight react-like maximum-optimistic library for building user interfaces.

wili Wili is a 2kb Light-weight react-like maximum-optimistic library for building user interfaces. Usage Welcome componenet: class Welcome extends Wi

Amir Fo 3 Feb 16, 2022
This is full stack todo Application which has front end and backend side on my own. So you can try this out. Build using

Full Stack Todo Application Hello Everyone... Here I am sharing some information about the TODO APP which I build using React, Redux, Material UI, Exp

Nayan Ingale 5 Nov 8, 2022
This project is a Vegan recipe application. I created with React Native. Check out VeganRecipe now for recipe app

VeganRecipe ?? ?? ?? ?? Hello! This project is a Vegan recipe application. I created with React Native. Check out VeganRecipe now for recipe app. ?? ?

Murat 4 Mar 27, 2022
Fetching data from REST COUNTRIES API, this app (mobile version for now) gives information like area, population, capital, and borders for 195 countries from seven continents.

Space Travellers' Hub World Countries App works with an API which returns informations about 195 countries. Fetching data from REST COUNTRIES API, thi

Nicolae Pop 7 Aug 8, 2022