Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/botsquad/sentence-annotator
Typescript React component to annotate (label) sentences
https://github.com/botsquad/sentence-annotator
Last synced: 15 days ago
JSON representation
Typescript React component to annotate (label) sentences
- Host: GitHub
- URL: https://github.com/botsquad/sentence-annotator
- Owner: botsquad
- License: mit
- Created: 2020-01-02T09:27:36.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-01-15T03:14:14.000Z (almost 3 years ago)
- Last Synced: 2024-11-16T02:38:50.904Z (about 2 months ago)
- Language: TypeScript
- Homepage: https://sentence-annotator-example.apps.botsqd.com/
- Size: 1.56 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: code-of-conduct.md
Awesome Lists containing this project
README
# Sentence Annotator component
[![Build Status](https://travis-ci.com/botsquad/sentence-annotator.svg?branch=master)](https://travis-ci.com/botsquad/sentence-annotator)
[![npm (scoped)](https://img.shields.io/npm/v/@botsquad/sentence-annotator)](https://www.npmjs.com/package/@botsquad/sentence-annotator)This is a React component for creating a text input box which understands Dialogflow's _user
utterance_ JSON format, and allows one to use an interface similar to Dialogflow's utterance editor
as a React component.## Example code
```javascript
import React, { useState } from "react";
import ReactDOM from "react-dom";import { SentenceAnnotator } from '@botsquad/sentence-annotator';
const initial = {
data: [
{
text: 'whatever you do, please please do remember that my ',
},
{
text: 'nickname',
name: 'type',
entity: '@name-type',
},
{
text: ' is ',
},
{
text: 'pete',
name: 'nick-name',
entity: '@nick-name',
}
],
};const Example = () => {
const [sentence, setSentence] = useState(initial)return (
SentenceEditor component
)
}ReactDOM.render(, document.getElementById("root"))
);
```There is also a `StringSentenceAnnotator` component which works similarly, but converts the result
to a string; which contains the annotations in markdown syntax.