Spaces:
No application file
No application file
File size: 839 Bytes
fe2f058 eb62114 fe2f058 eb62114 fe2f058 eb62114 fe2f058 eb62114 fe2f058 eb62114 a70f441 f264cce fe2f058 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
import gradio as gr
def letter_counter(word: str, letter: str) -> int:
"""Count occurrences of a letter in a word.
Args:
word: The word to search in
letter: The letter to count
Returns:
Number of times the letter appears in the word
"""
return word.lower().count(letter.lower())
demo = gr.Interface(fn=letter_counter,
inputs=["text", "text"],
outputs="number",
placeholder="Result will be displayed here..."),
title="Sentiment Analysis",
description="This app analyzes the sentiment of the input text using TextBlob and returns the polarity, subjectivity, and assessment.",
theme="default")
demo.launch(mcp_server=True) # exposes an MCP schema automatically |