Skip to content

return of predict #3

@lucarlig

Description

@lucarlig

safe_model.predict().unwrap() returns a Vec<String> with the string being separate by commas which is hard to work with because it's difficult to tell what number stands for what. Ideally would like it to return a vector of something like this:

struct Prediction {
    pub file: String,
    pub line: u32,
    pub col: u32,
    pub text: String,
    pub class: String,
    pub probability: String,
}

this could give an option to convert it to a JSON return returning a Vec in a Json file or directly use it if working with this crate in the library version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions