private AnnotationLayer createTokenLayer(Project aProject) throws IOException { AnnotationLayer tokenLayer = new AnnotationLayer(Token.class.getName(), "Token", SPAN_TYPE, aProject, true, AnchoringMode.SINGLE_TOKEN); annotationSchemaService.createLayer(tokenLayer); return tokenLayer; } }
@Override public void configure(Project aProject) throws IOException { AnnotationLayer tokenLayer = new AnnotationLayer(Token.class.getName(), "Token", SPAN_TYPE, aProject, true, AnchoringMode.SINGLE_TOKEN); annotationSchemaService.createLayer(tokenLayer); } }
private AnnotationLayer createTokenLayer(Project aProject) throws IOException { AnnotationLayer tokenLayer = new AnnotationLayer(Token.class.getName(), "Token", SPAN_TYPE, aProject, true, AnchoringMode.SINGLE_TOKEN); annotationSchemaService.createLayer(tokenLayer); return tokenLayer; } }
@Override public void configure(Project aProject) throws IOException { AnnotationLayer tokenLayer = new AnnotationLayer(Token.class.getName(), "Token", SPAN_TYPE, aProject, true, AnchoringMode.SINGLE_TOKEN); // Since the user cannot turn off validation for the token layer if there is any kind of // problem with the validation functionality we are conservative here and disable validation // from the start. tokenLayer.setValidationMode(NEVER); annotationSchemaService.createLayer(tokenLayer); } }
private void createNeLayer(Project aProject, TagSet aTagSet) throws IOException { AnnotationLayer neLayer = new AnnotationLayer(NamedEntity.class.getName(), "Named entity", SPAN_TYPE, aProject, true, AnchoringMode.TOKENS); neLayer.setAllowStacking(true); annotationSchemaService.createLayer(neLayer); annotationSchemaService.createFeature(new AnnotationFeature(aProject, neLayer, "value", "value", CAS.TYPE_NAME_STRING, "Named entity type", aTagSet)); }
private void createNeLayer(Project aProject, TagSet aTagSet) throws IOException { AnnotationLayer neLayer = new AnnotationLayer(NamedEntity.class.getName(), "Named entity", SPAN_TYPE, aProject, true, AnchoringMode.TOKENS); neLayer.setAllowStacking(true); annotationSchemaService.createLayer(neLayer); annotationSchemaService.createFeature(new AnnotationFeature(aProject, neLayer, "value", "value", CAS.TYPE_NAME_STRING, "Named entity type", aTagSet)); }
@Override public void configure(Project aProject) throws IOException { TagSet nerTagSet = JsonImportUtil.importTagSetFromJson(aProject, new ClassPathResource("/tagsets/de-ne-webanno.json").getInputStream(), annotationSchemaService); AnnotationLayer neLayer = new AnnotationLayer(NamedEntity.class.getName(), "Named entity", SPAN_TYPE, aProject, true, AnchoringMode.TOKENS); neLayer.setAllowStacking(true); annotationSchemaService.createLayer(neLayer); annotationSchemaService.createFeature(new AnnotationFeature(aProject, neLayer, "value", "value", CAS.TYPE_NAME_STRING, "Named entity type", nerTagSet)); } }
@Override public void configure(Project aProject) throws IOException { TagSet nerTagSet = JsonImportUtil.importTagSetFromJson(aProject, new ClassPathResource("/tagsets/de-ne-webanno.json").getInputStream(), annotationSchemaService); AnnotationLayer neLayer = new AnnotationLayer(NamedEntity.class.getName(), "Named entity", SPAN_TYPE, aProject, true, AnchoringMode.TOKENS); neLayer.setAllowStacking(true); annotationSchemaService.createLayer(neLayer); annotationSchemaService.createFeature(new AnnotationFeature(aProject, neLayer, "value", "value", CAS.TYPE_NAME_STRING, "Named entity type", nerTagSet)); } }
private void createPOSLayer(Project aProject, TagSet aPosTagset) throws IOException { AnnotationLayer tokenLayer = annotationSchemaService.getLayer(Token.class.getName(), aProject); AnnotationLayer posLayer = new AnnotationLayer(POS.class.getName(), "POS", SPAN_TYPE, aProject, true, AnchoringMode.SINGLE_TOKEN); AnnotationFeature tokenPosFeature = new AnnotationFeature(aProject, tokenLayer, "pos", "pos", POS.class.getName()); annotationSchemaService.createFeature(tokenPosFeature); posLayer.setAttachType(tokenLayer); posLayer.setAttachFeature(tokenPosFeature); annotationSchemaService.createLayer(posLayer); annotationSchemaService.createFeature(new AnnotationFeature(aProject, posLayer, "PosValue", "PosValue", CAS.TYPE_NAME_STRING, "Part-of-speech tag", aPosTagset)); }
private void createPOSLayer(Project aProject, TagSet aPosTagset) throws IOException { AnnotationLayer tokenLayer = annotationSchemaService.getLayer(Token.class.getName(), aProject); AnnotationLayer posLayer = new AnnotationLayer(POS.class.getName(), "POS", SPAN_TYPE, aProject, true, AnchoringMode.SINGLE_TOKEN); AnnotationFeature tokenPosFeature = new AnnotationFeature(aProject, tokenLayer, "pos", "pos", POS.class.getName()); annotationSchemaService.createFeature(tokenPosFeature); posLayer.setAttachType(tokenLayer); posLayer.setAttachFeature(tokenPosFeature); annotationSchemaService.createLayer(posLayer); annotationSchemaService.createFeature(new AnnotationFeature(aProject, posLayer, "PosValue", "PosValue", CAS.TYPE_NAME_STRING, "Part-of-speech tag", aPosTagset)); }
@Override public void configure(Project aProject) throws IOException { TagSet posTagSet = JsonImportUtil.importTagSetFromJson(aProject, new ClassPathResource("/tagsets/mul-pos-ud.json").getInputStream(), annotationSchemaService); AnnotationLayer tokenLayer = annotationSchemaService.getLayer(Token.class.getName(), aProject); AnnotationLayer posLayer = new AnnotationLayer(POS.class.getName(), "POS", SPAN_TYPE, aProject, true, AnchoringMode.SINGLE_TOKEN); AnnotationFeature tokenPosFeature = new AnnotationFeature(aProject, tokenLayer, "pos", "pos", POS.class.getName()); annotationSchemaService.createFeature(tokenPosFeature); posLayer.setAttachType(tokenLayer); posLayer.setAttachFeature(tokenPosFeature); annotationSchemaService.createLayer(posLayer); annotationSchemaService.createFeature(new AnnotationFeature(aProject, posLayer, "PosValue", "PosValue", CAS.TYPE_NAME_STRING, "Part-of-speech tag", posTagSet)); } }
private ArgumentCaptor<AnnotationLayer> runExportImportAndFetchEvents() throws Exception { // Export the project ProjectExportRequest exportRequest = new ProjectExportRequest(); exportRequest.setProject(project); ExportedProject exportedProject = new ExportedProject(); sut.exportData(exportRequest, exportedProject, workFolder); // Import the project again ArgumentCaptor<AnnotationLayer> captor = ArgumentCaptor.forClass(AnnotationLayer.class); doNothing().when(annotationService).createLayer(captor.capture()); ProjectImportRequest importRequest = new ProjectImportRequest(true); ZipFile zipFile = mock(ZipFile.class); sut.importData(importRequest, project, exportedProject, zipFile); return captor; } }
@Override public void configure(Project aProject) throws IOException { AnnotationLayer chunkLayer = new AnnotationLayer(Chunk.class.getName(), "Chunk", SPAN_TYPE, aProject, true, AnchoringMode.TOKENS); chunkLayer.setAllowStacking(false); annotationSchemaService.createLayer(chunkLayer); AnnotationFeature chunkValueFeature = new AnnotationFeature(); chunkValueFeature.setDescription("Chunk tag"); chunkValueFeature.setName("chunkValue"); chunkValueFeature.setType(CAS.TYPE_NAME_STRING); chunkValueFeature.setProject(aProject); chunkValueFeature.setUiName("Tag"); chunkValueFeature.setLayer(chunkLayer); annotationSchemaService.createFeature(chunkValueFeature); } }
private void createChunkLayer(Project aProject) throws IOException { AnnotationLayer chunkLayer = new AnnotationLayer(Chunk.class.getName(), "Chunk", SPAN_TYPE, aProject, true, AnchoringMode.TOKENS); chunkLayer.setAllowStacking(false); annotationSchemaService.createLayer(chunkLayer); AnnotationFeature chunkValueFeature = new AnnotationFeature(); chunkValueFeature.setDescription("Chunk tag"); chunkValueFeature.setName("chunkValue"); chunkValueFeature.setType(CAS.TYPE_NAME_STRING); chunkValueFeature.setProject(aProject); chunkValueFeature.setUiName("Tag"); chunkValueFeature.setLayer(chunkLayer); annotationSchemaService.createFeature(chunkValueFeature); }
private void createChunkLayer(Project aProject) throws IOException { AnnotationLayer chunkLayer = new AnnotationLayer(Chunk.class.getName(), "Chunk", SPAN_TYPE, aProject, true, AnchoringMode.TOKENS); chunkLayer.setAllowStacking(false); annotationSchemaService.createLayer(chunkLayer); AnnotationFeature chunkValueFeature = new AnnotationFeature(); chunkValueFeature.setDescription("Chunk tag"); chunkValueFeature.setName("chunkValue"); chunkValueFeature.setType(CAS.TYPE_NAME_STRING); chunkValueFeature.setProject(aProject); chunkValueFeature.setUiName("Tag"); chunkValueFeature.setLayer(chunkLayer); annotationSchemaService.createFeature(chunkValueFeature); }
@Override public void configure(Project aProject) throws IOException { AnnotationLayer chunkLayer = new AnnotationLayer(Chunk.class.getName(), "Chunk", SPAN_TYPE, aProject, true, AnchoringMode.TOKENS); chunkLayer.setAllowStacking(false); annotationSchemaService.createLayer(chunkLayer); AnnotationFeature chunkValueFeature = new AnnotationFeature(); chunkValueFeature.setDescription("Chunk tag"); chunkValueFeature.setName("chunkValue"); chunkValueFeature.setType(CAS.TYPE_NAME_STRING); chunkValueFeature.setProject(aProject); chunkValueFeature.setUiName("Tag"); chunkValueFeature.setLayer(chunkLayer); annotationSchemaService.createFeature(chunkValueFeature); } }
private AnnotationLayer createCorefLayer(Project aProject, TagSet aCorefTypeTags, TagSet aCorefRelTags) throws IOException { AnnotationLayer base = new AnnotationLayer( "de.tudarmstadt.ukp.dkpro.core.api.coref.type.Coreference", "Coreference", CHAIN_TYPE, aProject, true, AnchoringMode.TOKENS); base.setCrossSentence(true); base.setAllowStacking(true); annotationSchemaService.createLayer(base); annotationSchemaService.createFeature(new AnnotationFeature(aProject, base, "referenceType", "referenceType", CAS.TYPE_NAME_STRING, "Coreference type", aCorefTypeTags)); annotationSchemaService.createFeature( new AnnotationFeature(aProject, base, "referenceRelation", "referenceRelation", CAS.TYPE_NAME_STRING, "Coreference relation", aCorefRelTags)); return base; }
private AnnotationLayer createCorefLayer(Project aProject, TagSet aCorefTypeTags, TagSet aCorefRelTags) throws IOException { AnnotationLayer base = new AnnotationLayer( "de.tudarmstadt.ukp.dkpro.core.api.coref.type.Coreference", "Coreference", CHAIN_TYPE, aProject, true, AnchoringMode.TOKENS); base.setCrossSentence(true); base.setAllowStacking(true); annotationSchemaService.createLayer(base); annotationSchemaService.createFeature(new AnnotationFeature(aProject, base, "referenceType", "referenceType", CAS.TYPE_NAME_STRING, "Coreference type", aCorefTypeTags)); annotationSchemaService.createFeature( new AnnotationFeature(aProject, base, "referenceRelation", "referenceRelation", CAS.TYPE_NAME_STRING, "Coreference relation", aCorefRelTags)); return base; }
@Override public void configure(Project aProject) throws IOException { // The surface form must be locked to tokens for CoNLL-U writer to work properly AnnotationLayer surfaceFormLayer = new AnnotationLayer(SurfaceForm.class.getName(), "Surface form", SPAN_TYPE, aProject, true, AnchoringMode.TOKENS); surfaceFormLayer.setAllowStacking(false); annotationSchemaService.createLayer(surfaceFormLayer); AnnotationFeature surfaceFormValueFeature = new AnnotationFeature(); surfaceFormValueFeature.setDescription("Original surface text"); surfaceFormValueFeature.setName("value"); surfaceFormValueFeature.setType(CAS.TYPE_NAME_STRING); surfaceFormValueFeature.setProject(aProject); surfaceFormValueFeature.setUiName("Form"); surfaceFormValueFeature.setLayer(surfaceFormLayer); annotationSchemaService.createFeature(surfaceFormValueFeature); } }
@Override public void configure(Project aProject) throws IOException { // The surface form must be locked to tokens for CoNLL-U writer to work properly AnnotationLayer surfaceFormLayer = new AnnotationLayer(SurfaceForm.class.getName(), "Surface form", SPAN_TYPE, aProject, true, AnchoringMode.TOKENS); surfaceFormLayer.setAllowStacking(false); annotationSchemaService.createLayer(surfaceFormLayer); AnnotationFeature surfaceFormValueFeature = new AnnotationFeature(); surfaceFormValueFeature.setDescription("Original surface text"); surfaceFormValueFeature.setName("value"); surfaceFormValueFeature.setType(CAS.TYPE_NAME_STRING); surfaceFormValueFeature.setProject(aProject); surfaceFormValueFeature.setUiName("Form"); surfaceFormValueFeature.setLayer(surfaceFormLayer); annotationSchemaService.createFeature(surfaceFormValueFeature); } }