mirror of https://github.com/doccano/doccano.git
pythondatasetsactive-learningtext-annotationdatasetnatural-language-processingdata-labelingmachine-learningannotation-tool
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
69 lines
1.6 KiB
69 lines
1.6 KiB
<template>
|
|
<base-text-area>
|
|
<template #title>
|
|
<multi-class-classification
|
|
v-if="currentDoc"
|
|
:labels="items"
|
|
:annotations="currentDoc.annotations"
|
|
:add-label="addLabel"
|
|
:delete-label="removeLabel"
|
|
/>
|
|
</template>
|
|
<template #content>
|
|
<div v-if="currentDoc" class="title">
|
|
{{ currentDoc.text }}<!-- {{currentDoc}}-->
|
|
</div>
|
|
</template>
|
|
</base-text-area>
|
|
</template>
|
|
|
|
<script>
|
|
import { mapActions, mapGetters, mapState } from 'vuex'
|
|
import BaseTextArea from '@/components/molecules/BaseTextArea'
|
|
import MultiClassClassification from '@/components/organisms/MultiClassClassification'
|
|
|
|
export default {
|
|
components: {
|
|
BaseTextArea,
|
|
MultiClassClassification
|
|
},
|
|
|
|
computed: {
|
|
...mapState('labels', ['items']),
|
|
...mapGetters('documents', ['currentDoc'])
|
|
},
|
|
|
|
created() {
|
|
this.getLabelList()
|
|
this.getDocumentList()
|
|
},
|
|
|
|
methods: {
|
|
...mapActions('labels', ['getLabelList']),
|
|
...mapActions('documents', ['getDocumentList', 'deleteAnnotation', 'updateAnnotation', 'addAnnotation']),
|
|
removeLabel(annotationId) {
|
|
const payload = {
|
|
annotationId,
|
|
projectId: this.$route.params.id
|
|
}
|
|
this.deleteAnnotation(payload)
|
|
},
|
|
updateLabel(labelId, annotationId) {
|
|
const payload = {
|
|
annotationId,
|
|
label: labelId,
|
|
projectId: this.$route.params.id
|
|
}
|
|
this.updateAnnotation(payload)
|
|
},
|
|
addLabel(labelId) {
|
|
alert(labelId)
|
|
const payload = {
|
|
label: labelId,
|
|
projectId: this.$route.params.id
|
|
}
|
|
this.addAnnotation(payload)
|
|
}
|
|
}
|
|
}
|
|
</script>
|