Text output of the text based on a lab from a CoreMLDataModel

Hello,

I have created a data model with Text Classification which contains many garments with the label clothing, technology equipment with the label technology, etc.... . I have inserted it so that when entering for example "T-shirt" the label clothing is output. But I want it so that when I create an equipment category with the clothing, that it suggests me clothing items, which I add. How do I implement this. In the function you can only use"preditction.label". I program with SwiftUI.

func textml() {
        do {

            let model = try DataModel_Symbols_Consilia(configuration: .init())

            let prediction = try model.prediction(text: addProjectVM.title)

            addProjectVM.symbol = prediction.label

        } catch {

            modelOutput = "Something went wrong"

        }

    }

Greetings Janik

Hey Janik,

Thanks for writing! I'm not quite understanding the data structure that you have, it sounds like you have a set of text which contains either garments that you've labeled with clothing or equipment that you have labeled with technology? Seeing a sample of the data would help a lot.

In any case, it seems like you've set up the Text Classification model well, and what you would like to do now is employ a Recommender model on the result of the Classification. Here's a guide on training a Recommender model using CreateML.

Hope that helps! Jack

Hello Jack, thanks for the feedback. The data model looks like this:

I have the folder Data. In this folder are two subfolders: Clothing and Technology. In the Clothes folder there are many individual text files containing T-shirt, pants, socks, cap, etc.. . In technology with the content camera, notebook, battery, etc.... . I have trained it so that if I enter camera with technology is output, or if I enter pants me clothing is output. But I would like to have it so that if I have a category in the app with the name clothing me the different clothes should be output. Because the app should work in such a way that you can create equipment lists and you are given suggestions for the content for each category to help you. As support. When I bag clothes, for example, socks should be suggested to me, or pants.

Janik

Okay cool, I think I understand it better now. I think from what you're saying, what you're going to get the most value out of is actually structuring your training data differently and then running the training exactly the same. So for example, instead of having subfolders as Clothing and Technology, break them down further into the more specific categories you're looking for, Socks, Pants, etc. The text classifier training should work the same, but at the granularity you're looking for.

Text output of the text based on a lab from a CoreMLDataModel
 
 
Q