Thank you for that and sorry for all the newbie questions. So what I try now is to replicate the example I've found in the forum . Where do I need to store the custome recipe and how can I call it ? Do I need to place it directly in the library or can I somehow reference it somewhere? I tried to replicate the example here is what I have.
#my_recipe.py
import prodigy
from prodigy.components.loaders import JSONL
with open('textcat_eval.html') as txt:
template_text = txt.read()
with open('textcat_eval.js') as txt:
script_text = txt.read()
@prodigy.recipe('sentiment',dataset=prodigy.recipe_args['dataset'],file_path=("Path to texts", "positional", None, str))
def sentiment(dataset, file_path):
"""Annotate the sentiment of texts using different mood options."""
stream = JSONL(file_path) # load in the JSONL file
return {
'dataset':dataset,
'stream':stream,
'view_id': 'html',
'config': {
'html_template': template_text,
'html_script': script_text,
}
}
<!--textcat_eval.html-->
<h2>{{text}}</h2>
<input type="text" class="input" placeholder="User text here..." />
<button onClick="updateFromInput()">Update</button>
<br />
{{user_text}}
j
//textcat_eval.js
function updateFromInput() {
const text = document.querySelector('.input').value;
window.prodigy.update({ user_text: text });
}
Could you kindly tell me what to do from here to get this thing running. Where to place the code files and how to call them?
Thanks