Skip to content

Commit ee0d4e0

Browse files
authored
Merge pull request #28 from keighrim/main
updated README to refer to the common user manual
2 parents f2d5eff + 32655f1 commit ee0d4e0

File tree

1 file changed

+2
-47
lines changed

1 file changed

+2
-47
lines changed

README.md

Lines changed: 2 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,4 @@
1-
# CLAMS-spaCy wrapper
1+
## User instruction
22

3-
The spaCy NLP wrapped as a CLAMS service, spaCy is distributed under the [MIT license](https://github.com/explosion/spaCy/blob/master/LICENSE).
4-
5-
This requires Python 3.8 or higher. For local install of required Python modules see [requirements.txt](requirements.txt).
6-
7-
## Using this service
8-
9-
Use `python app.py -t example-mmif.json out.json` just to test the wrapping code without using a server. To test this using a server you run the app as a service in one terminal:
10-
11-
```bash
12-
$ python app.py
13-
```
14-
15-
And poke at it from another:
16-
17-
```bash
18-
$ curl http://0.0.0.0:5000/
19-
$ curl -H "Accept: application/json" -X POST [email protected] http://0.0.0.0:5000/
20-
```
21-
22-
In CLAMS you usually run this in a container. To create an image
23-
24-
```bash
25-
$ docker build -f Containerfile -t clams-spacy-wrapper .
26-
```
27-
28-
And to run it as a container:
29-
30-
```bash
31-
$ docker run --rm -d -p 5000:5000 clams-spacy-wrapper
32-
$ curl -H "Accept: application/json" -X POST [email protected] http://0.0.0.0:5000/
33-
```
34-
35-
The spaCy code will run on each text document in the input MMIF file. The file `example-mmif.json` has one text document in the top level `documents` property and two text documents in one of the views. The text documents all look as follows:
36-
37-
```json
38-
{
39-
"@type": "http://mmif.clams.ai/0.4.0/vocabulary/TextDocument",
40-
"properties": {
41-
"id": "m2",
42-
"text": {
43-
"@value": "Hello, this is Jim Lehrer with the NewsHour on PBS...."
44-
}
45-
}
46-
}
47-
```
48-
Instead of a `text:@value` property the text could in an external file, which would be given as a URI in the `location` property. See the readme file in [https://github.com/clamsproject/app-nlp-example](https://github.com/clamsproject/app-nlp-example) on how to do this.
3+
General user instructions for CLAMS apps is available at [CLAMS Apps documentation](https://apps.clams.ai/clamsapp).
494

0 commit comments

Comments
 (0)