tribuo icon indicating copy to clipboard operation
tribuo copied to clipboard

Add a simple way to use preprocessors with SimpleTextDataSource

Open olivierceulemans opened this issue 3 years ago • 1 comments

I just tried using SimpleTextDataSource with a custom preprocessor but ended up creating a custom subclass of TextDataSource just for this.

I think it would be great if the class SimpleTextDataSource would accept a list of DocumentPreprocessor in its constructors' arguments. The parent class has these arguments.

olivierceulemans avatar Dec 29 '22 13:12 olivierceulemans

We can add that, though SimpleTextDataSource constrains the input format for the text to an internal format we'd been using for years and we had expected that most users would prefer to write their own TextDataSource implementation for their own data rather than change their data to our half-baked format. If it's easier to change the data then we can expose the document preprocessors.

We should note in the docs that the expected path for more complicated text is to subclass TextDataSource and customize the read method.

Craigacp avatar Dec 30 '22 02:12 Craigacp