Skip to content

Commit a2807d0

Browse files
authored
Update README.md
1 parent 3974ae0 commit a2807d0

File tree

1 file changed

+38
-1
lines changed

1 file changed

+38
-1
lines changed

README.md

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# React NLP Annotate
22

3-
Interface for doing various NLP tasks.
3+
Interface for doing various NLP tasks. [Here's a code playground](https://codesandbox.io/s/react-nlp-annotate-example-0jwms?file=/src/App.js). Please help this repository by adding documentation and issues!
44

55
- Audio transcription
66
- Text Labeling (Entity, Classification)
@@ -46,3 +46,40 @@ const MyComponent = () => (
4646
/>
4747
)
4848
```
49+
50+
### Entity Relation Labeling
51+
52+
```javascript
53+
import React from "react";
54+
import NLPAnnotator from "react-nlp-annotate";
55+
56+
const labels = [
57+
{
58+
id: "gryffindor",
59+
displayName: "Gryffindor",
60+
description: "Daring, strong nerve and chivalry."
61+
},
62+
{
63+
id: "slytherin",
64+
displayName: "Slytherin",
65+
description: "Cunning and ambitious. Possibly dark wizard."
66+
}
67+
];
68+
69+
export default () => (
70+
<NLPAnnotator
71+
hotkeysEnabled
72+
type="label-relationships"
73+
labels={labels}
74+
multipleLabels={false}
75+
document="Harry was an honest to god good man"
76+
onChange={(output) => {
77+
console.log("Output is...", output);
78+
}}
79+
// this is just for label-relationships
80+
entityLabels={labels}
81+
relationshipLabels={labels}
82+
/>
83+
</div>
84+
);
85+
```

0 commit comments

Comments
 (0)