blazingbunny commited on
Commit
d5d75ac
·
verified ·
1 Parent(s): 5b0d3b2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +34 -9
app.py CHANGED
@@ -151,18 +151,43 @@ def create_annotated_text(original_text, word_results):
151
  def create_interface():
152
  with gr.Blocks(title="Google Cloud Natural Language Classifier") as app:
153
  gr.Markdown("""
154
- # Google Cloud Natural Language Text Classifier
155
 
156
- This app uses Google Cloud's Natural Language API to classify text content.
157
 
158
- **Setup Requirements:**
159
- 1. Set up Google Cloud credentials as environment variable `GOOGLE_APPLICATION_CREDENTIALS_JSON`
160
- 2. Enable the Natural Language API in your Google Cloud project
161
 
162
- **Features:**
163
- - Classifies individual words in your text
164
- - Classifies the entire paragraph
165
- - Shows confidence scores for all classifications
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
166
  """)
167
 
168
  with gr.Row():
 
151
  def create_interface():
152
  with gr.Blocks(title="Google Cloud Natural Language Classifier") as app:
153
  gr.Markdown("""
154
+ # Google Cloud Natural Language Text Classifier (V2 Model)
155
 
156
+ This intelligent text classification tool leverages Google Cloud's powerful Natural Language API V2 model to analyze and categorize your content with high accuracy and confidence scores.
157
 
158
+ ## How to Use This Tool
 
 
159
 
160
+ 1. **Enter Your Text**: Type or paste any paragraph, article excerpt, or text content into the input box on the left
161
+ 2. **Click "Analyze Text"**: Hit the analyze button to process your content
162
+ 3. **Review Results**: The tool provides three types of analysis:
163
+ - **Word-Level Classification**: Each unique word gets categorized individually with confidence scores
164
+ - **Annotated Text**: Your original text with inline category labels and confidence scores
165
+ - **Paragraph-Level Classification**: The entire text analyzed as a cohesive unit
166
+
167
+ ## What You'll Get
168
+
169
+ - **Detailed Categories**: Content is classified into specific categories like `/Arts & Entertainment/Movies`, `/Business & Industrial/Finance`, `/Health/Medical`, etc.
170
+ - **Confidence Scores**: Each classification includes a confidence score (0-1) indicating how certain the AI is about the categorization
171
+ - **Multiple Classifications**: Words and paragraphs can belong to multiple categories simultaneously
172
+ - **Comprehensive Analysis**: Both granular (word-level) and holistic (paragraph-level) insights
173
+
174
+ ## Perfect For
175
+
176
+ - Content creators organizing their material
177
+ - Researchers analyzing text themes
178
+ - Marketers understanding content categories
179
+ - Students exploring text classification
180
+ - Anyone curious about how AI categorizes written content
181
+
182
+ ## Powered By
183
+
184
+ This tool uses Google Cloud's Natural Language API V2 model for superior performance and accuracy. The V2 model supports an expanded set of content categories for more precise classification.
185
+
186
+ **Source**: [Google Cloud Natural Language API - Content Categories](https://cloud.google.com/natural-language/docs/categories#version_2)
187
+
188
+ ---
189
+
190
+ **Try the examples below or enter your own text to get started!**
191
  """)
192
 
193
  with gr.Row():