Browse Source

add excel import to frontend

pull/872/head
Christian Gill 4 years ago
parent
commit
c7278ebdd8
1 changed files with 21 additions and 2 deletions
  1. 23
      frontend/store/projects.js

23
frontend/store/projects.js

@ -65,6 +65,11 @@ export const getters = {
text: 'CoNLL',
accept: '.conll'
}
const excel = {
type: 'excel',
text: 'Excel',
accept: '.xlsx'
}
if (state.current.project_type === 'DocumentClassification') {
json.examples = [
'{"text": "Terrible customer service.", "labels": ["negative"]}\n',
@ -77,10 +82,17 @@ export const getters = {
'"Really great transaction.","positive"\n',
'"Great price.","positive"'
]
excel.examples = [
'text,label\n',
'"Terrible customer service.","negative"\n',
'"Really great transaction.","positive"\n',
'"Great price.","positive"'
]
return [
plain,
csv,
json
json,
excel
]
} else if (state.current.project_type === 'SequenceLabeling') {
json.examples = [
@ -118,10 +130,17 @@ export const getters = {
'"Good morning.","おはようございます。"\n',
'"See you.","さようなら。"'
]
excel.examples = [
'text,label\n',
'"Hello!","こんにちは!"\n',
'"Good morning.","おはようございます。"\n',
'"See you.","さようなら。"'
]
return [
plain,
csv,
json
json,
excel
]
} else {
return []

Loading…
Cancel
Save