Sorry if the title isn’t very descriptive.
Say I have a model such as GPT or T5 and I make it generate some text, now I want to do something with this text, for example, count how many title case words are in it, and have a label that says 5.
Now I want to train the generative model on the loss between the number of title case words of the generated text and my label (5).
Is it possible for me to create a loss function that relies on functions (and probably data) outside of pytorch’s scope? Or is this example of mine a possible scenario?
Thanks!