cyberandy commited on
Commit
06bf063
·
verified ·
1 Parent(s): 2c742a1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -154,7 +154,6 @@ def call_wordlift_api(text: str, keywords: Optional[List[str]] = None) -> Option
154
  # ------------------------
155
  # Main Evaluation Batch Function
156
  # ------------------------
157
-
158
  def evaluate_urls_batch(url_data: pd.DataFrame):
159
  """
160
  Evaluates a batch of URLs using the WordLift API.
@@ -167,7 +166,9 @@ def evaluate_urls_batch(url_data: pd.DataFrame):
167
  - A pandas DataFrame with the summary results.
168
  - A dictionary containing the full results (including errors) keyed by URL.
169
  """
170
- if not url_data or url_data.empty:
 
 
171
  return pd.DataFrame(columns=['URL', 'Status', 'Overall Score', 'Content Purpose', 'Content Accuracy', 'Content Depth', 'Readability Score (API)', 'Readability Grade Level', 'SEO Score', 'Word Count', 'Error/Details']), {}
172
 
173
  summary_results = []
 
154
  # ------------------------
155
  # Main Evaluation Batch Function
156
  # ------------------------
 
157
  def evaluate_urls_batch(url_data: pd.DataFrame):
158
  """
159
  Evaluates a batch of URLs using the WordLift API.
 
166
  - A pandas DataFrame with the summary results.
167
  - A dictionary containing the full results (including errors) keyed by URL.
168
  """
169
+ # Corrected check: Use .empty to see if the DataFrame has any rows
170
+ if url_data.empty:
171
+ logger.info("Input DataFrame is empty. Returning empty results.")
172
  return pd.DataFrame(columns=['URL', 'Status', 'Overall Score', 'Content Purpose', 'Content Accuracy', 'Content Depth', 'Readability Score (API)', 'Readability Grade Level', 'SEO Score', 'Word Count', 'Error/Details']), {}
173
 
174
  summary_results = []