Open robingenz opened 1 year ago
Unfortunately, there is no operator thaking a string and returning a numerical information like you need and no way to do that with the existing op. So you would need to introduce a new operator to onnx. It can be in onnx repository but it needs to be approved by the community. You may need to attend one the SIG meeting: https://github.com/microsoft/onnxruntime-extensions/blob/main/docs/custom_ops.md. It can be a custom operator implemented in python (see onnxruntime-extensions) or in C++ depending on where you need to deploy.
Once it is done, a new converter needs to be registered in sklearn-onnx to convert your custom transformer.
You should follow this PR https://github.com/onnx/onnx/pull/5417. Once it is merged, it will be part of onnx standard and onnxruntime will implement it.
I am currently working on a model that takes as input, among other data, a string in ISO 8601 datetime format. This string should be converted into a (numeric) timestamp using a converter.
Example:
2023-06-13T04:53:00.280Z
1686631980
The sklearn pipeline looks like this:
(Unnecessary columns have been removed for clarity).
With the help of the
TimestampTransformer
the string in ISO 8601 datetime format is converted into a timestamp. Unfortunately I get the following error message when exporting the model to ONNX format:I understand the problem and have also read through the documentation on how to implement a new converter. Unfortunately I have no idea what is the best way to start. I am very new to the ONNX format and hope someone can give me a hint on how to solve this problem.