@Override public void configure(Project aProject) throws IOException { AnnotationLayer neLayer = annotationSchemaService.getLayer(NamedEntity.class.getName(), aProject); annotationSchemaService.createFeature(new AnnotationFeature(aProject, neLayer, "identifier", "identifier", ConceptFeatureSupport.TYPE_ANY_OBJECT, "Linked entity", null)); } }
@Override public void configure(Project aProject) throws IOException { AnnotationLayer neLayer = annotationSchemaService.getLayer(NamedEntity.class.getName(), aProject); annotationSchemaService.createFeature(new AnnotationFeature(aProject, neLayer, "identifier", "identifier", ConceptFeatureSupport.TYPE_ANY_OBJECT, "Linked entity", null)); } }
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 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 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 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 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 { 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)); } }
@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 actionDelete(AjaxRequestTarget aTarget) { confirmationDialog.setContentModel(new StringResourceModel("DeleteDialog.text", this) .setParameters(selectedTagSet.getObject().getName())); confirmationDialog.show(aTarget); confirmationDialog.setConfirmAction((_target) -> { // If the tagset is used in any features, clear the tagset on these features when // the tagset is deleted! for (AnnotationFeature ft : annotationSchemaService .listAnnotationFeature(selectedProject.getObject())) { if (ft.getTagset() != null && ft.getTagset().equals(selectedTagSet.getObject())) { ft.setTagset(null); annotationSchemaService.createFeature(ft); } } annotationSchemaService.removeTagSet(selectedTagSet.getObject()); _target.add(getPage()); actionCancel(_target); }); }
private void actionDelete(AjaxRequestTarget aTarget) { confirmationDialog.setContentModel(new StringResourceModel("DeleteDialog.text", this) .setParameters(selectedTagSet.getObject().getName())); confirmationDialog.show(aTarget); confirmationDialog.setConfirmAction((_target) -> { // If the tagset is used in any features, clear the tagset on these features when // the tagset is deleted! for (AnnotationFeature ft : annotationSchemaService .listAnnotationFeature(selectedProject.getObject())) { if (ft.getTagset() != null && ft.getTagset().equals(selectedTagSet.getObject())) { ft.setTagset(null); annotationSchemaService.createFeature(ft); } } annotationSchemaService.removeTagSet(selectedTagSet.getObject()); _target.add(getPage()); actionCancel(_target); }); }
@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); } }
@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); } }
@Override public void initialize(AnnotationSchemaService aSchemaService) { AnnotationFeature relationFeature = new AnnotationFeature(); relationFeature.setType(CAS.TYPE_NAME_STRING); relationFeature.setName(COREFERENCE_RELATION_FEATURE); relationFeature.setLayer(getLayer()); relationFeature.setEnabled(true); relationFeature.setUiName("Reference Relation"); relationFeature.setProject(getLayer().getProject()); aSchemaService.createFeature(relationFeature); AnnotationFeature typeFeature = new AnnotationFeature(); typeFeature.setType(CAS.TYPE_NAME_STRING); typeFeature.setName(COREFERENCE_TYPE_FEATURE); typeFeature.setLayer(getLayer()); typeFeature.setEnabled(true); typeFeature.setUiName("Reference Type"); typeFeature.setProject(getLayer().getProject()); aSchemaService.createFeature(typeFeature); }