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.
13 lines
430 B
13 lines
430 B
from .readers import BaseReader
|
|
from projects.models import Project
|
|
|
|
|
|
class Writer:
|
|
def __init__(self, batch_size: int):
|
|
self.batch_size = batch_size
|
|
|
|
def save(self, reader: BaseReader, project: Project, user):
|
|
for batch in reader.batch(self.batch_size):
|
|
examples = batch.create_data(project)
|
|
batch.create_label_type(project)
|
|
batch.create_label(project, user, examples)
|