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.
19 lines
560 B
19 lines
560 B
from typing import List
|
|
|
|
from .dataset import Dataset
|
|
from .formatters import Formatter
|
|
from .writers import Writer
|
|
|
|
|
|
class ExportApplicationService:
|
|
def __init__(self, dataset: Dataset, formatters: List[Formatter], writer: Writer):
|
|
self.dataset = dataset
|
|
self.formatters = formatters
|
|
self.writer = writer
|
|
|
|
def export(self, file):
|
|
dataset = self.dataset.to_dataframe()
|
|
for formatter in self.formatters:
|
|
dataset = formatter.format(dataset)
|
|
self.writer.write(file, dataset)
|
|
return file
|