Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ndlano/h5p-editor-keyword-extractor
H5P editor widget that extracts a (modifyable) list of keywords from texts
https://github.com/ndlano/h5p-editor-keyword-extractor
h5p
Last synced: about 5 hours ago
JSON representation
H5P editor widget that extracts a (modifyable) list of keywords from texts
- Host: GitHub
- URL: https://github.com/ndlano/h5p-editor-keyword-extractor
- Owner: NDLANO
- License: mit
- Created: 2023-06-01T13:20:43.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-07-15T10:44:46.000Z (4 months ago)
- Last Synced: 2024-07-15T12:49:37.013Z (4 months ago)
- Topics: h5p
- Language: JavaScript
- Homepage:
- Size: 1.03 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# H5P Editor Keyword Extractor
The purpose of this widget is to create the list of keywords. This widget allows
users to generate keywords from the text block and allow to add custom keywords
as well.## Getting started
Grab all the modules:
```bash
npm install
```Build project:
```bash
npm run build
```Development mode and watch
```bash
npm run watch
```## Example of usage
You can add the keyword extractor widget to a `Group` field in semantics.json like
so:
```
"name": "keywordExtractorGroup",
"label": "Keyword extractor",
"type": "group",
"widget": "KeywordExtractor",
"keywordExtractor": {
"buttons": {
"contentText": "extractKeywords",
"customKeywords": "parseKeywordsComma"
},
"keywords": "keywords"
},
```
Here,
- the widget is added by `"widget": "KeywordExtractor"` (you need to add the
widget as a library dependency as well, of course),
- one button to perform slightly intelligent keyword extraction from a text in a
`Text` field (optionally using a `Textarea` widget) is set to be the field with
the name `contentText`,
- one button to perform simple keyword extraction from a comma separated list of
keywords in a `Text` field is set to be the field with the name
`customKeywords`,
- the `Text` field that is supposed store the keywords is set to be field with
the name `keywords`.A complete `Group` field could look like this in `semantics.json`:
```
{
"name": "keywordExtractorGroup",
"label": "Keyword extractor",
"type": "group",
"importance": "low",
"expanded": true,
"widget": "KeywordExtractor",
"keywordExtractor": {
"buttons": {
"contentText": "extractKeywords",
"customKeywords": "parseKeywordsComma"
},
"keywords": "keywords"
},
"fields": [
{
"name": "contentText",
"label": "Content",
"description": "Reference text block for users.",
"type": "text",
"importance": "medium",
"optional": true,
"widget": "textarea"
},
{
"name": "customKeywords",
"description": "Add custom keywords of your choice, separated by comma.",
"type": "text",
"label": "Add keywords",
"importance": "low",
"optional": true
},
{
"name": "keywords",
"description": "Below listed keywords will available for users.",
"label": "Keywords",
"type": "text",
"importance": "medium",
"optional": true,
"maxLength": 5000
}
]
}
```