React文本标记器组件 - text-annotator

1,203 阅读1分钟

React Text Labeler Component annotator

react-text-annotator是一个标签器组件,它可以根据给定的数据铺设文本并叠加文本装饰,如标签、预测和关系。

它是可扩展的,允许自定义渲染标记和装饰叠加,并可与全键盘交互使用。

基本用法

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} />;

预览

image.png

The postReact Text Labeler Component - text-annotatorappeared first onReactScript.