API CALLS.md 4.02 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# Step by Step API calls for a complete user experience

## Description of the use case

User will set as a corpus three articles of "La voix du Nord".
It will applies onto it POS Tagging, Neologisms detection with Neoveille & motifs detection with SDMC.

## I: User set their corpus.

POST /corpora
Request Body:
``` javascript
{
  documents: [
    {
      corpusId: null, // Pas encore créé du coup....
      source: '/article1.txt',
      conlluBuffer: null // TO BE FILLED,maybe later?
    },
    {
      corpusId: null, // Pas encore créé du coup....
      source: '/article2.txt',
      conlluBuffer: null // TO BE FILLED,maybe later?
    },
    {
      corpusId: null, // Pas encore créé du coup....
      source: '/article3.txt',
      conlluBuffer: null // TO BE FILLED,maybe later?
    }
  ],
  createdBy: 'myUserId',
  type: 'public',
  creationDate: '12/10/2020 - 15h44',
  metadata: {
    author: 'La Voix du Nord',
    title: 'Trois articles récents du journal « La voix du Nord »',
    description: "Ces trois articles sont pris au hasard et ont été récupéré grâce à l'outil SOLR de Néoveille. Ils servent comme dummy corpus",
    date: null,
    type: 'Article de journal',
    size: null,
    language: 'fr',
    userMetadata: []
  }
}
```
System will now maybe check all the informations, then try to fill conlluBuffer of each documents by tokenizing the corpus. It will also need to compute the size of the corpus.

From now on, this document (as in a mongo document) will bear the id "corpusId".

## II: User set their pipeline

POST /pipelines
Request body:
``` javascript
{
  preTreatments: {
    sentenceSegmentation: false,
    wordSegmentation: true,
    posTagger: true,
    conversionToUTF: false
  },
  // Processes TO BE FILLED
  processes: [
    {
      moduleName: 'Neoveille',
      moduleParameters: [
        {
          name:,
          value:
        }
      ]
    },
    {
      moduleName: 'SDMC',
      moduleParameters: [
        {
          name:,
          value:
        }
      ]
    }
  ],
  creationDate: '12/10/2020 - 15h52',
  description: "Cette chaîne de traitement permet d'identifier les néologismes ainsi que les motifs récurrents."
}
```

This pipeline, created as a document will now bear the id "pipelineId".

## III: System creates a corpus process and starts it

Now that the system registered both the corpus and the pipeline. It can create the corpus process linking those two and start it.

POST /corpusProcesses
Request body:
``` javascript
{
  corpusId: corpusId,
  pipelineId: pipelineId,
  userId: 'myUserId',
  conllu: null, // Empty until filled by modules
  annotatedDocuments: [
    {
      documentId: article1DocumentId,
      corpusProcessId: null, // Same issue than in I: id not yet created
      annotations: []
    }
  ],
  outputs: null,
  currentProcessModule: null,
  status: 'Not started yet'
}
```

### Pre-Treatments executions

Once it is added to the collection, it will fetch the preTreatments in the document of the corresponding pipeline.

``` javascript
preTreatments: {
    sentenceSegmentation: false,
    wordSegmentation: true,
    posTagger: true,
    conversionToUTF: false
  }
```
wordSegmentation is supposed to be already done as we posted the corpus.

So the system will need to apply the POS Tagger to the corpus.

**TO BE FILLED**
```
I guess it needs to call /modules/treeTagger, 
fetch /corpora/corpusId or /corpusProcess/corpusProcessId and get its conllu which would be the concatenated version.
Then apply the process, then returning a conllu column that we can add to corpusProcess.conllu.
```
### First module execution

Once it is added to the collection, it will fetch the first process in the list of the corresponding pipelineId and call the module, then update:

POST /modules/Neoveille
Request body:
``` javascript
{
  // TO BE FILLED
  moduleParameters: [
    {
      name:,
      value:
    }
  ]
}
```

### At the same time: update of corpusProcess

PUT /corpusProcess/corpusProcessId
Request body:
``` javascript
{
  currentProcessingModule: 'Neoveille',
  status: 'Started'
}
```