From 58fb8e7d914487eab773c7afb708089a2c046dd0 Mon Sep 17 00:00:00 2001
From: ghaymah_dev
Date: Wed, 29 Oct 2025 14:09:50 +0000
Subject: [PATCH] Update main.py
---
main.py | 24 +-----------------------
1 file changed, 1 insertion(+), 23 deletions(-)
diff --git a/main.py b/main.py
index 34cdda7..184e256 100644
--- a/main.py
+++ b/main.py
@@ -8,7 +8,6 @@
from flask import Flask, request, jsonify
from flask_cors import CORS
-import spacy
import re
from collections import defaultdict
import json
@@ -22,28 +21,7 @@ CORS(app)
cached_results = {}
-def process_ranked_keywords(response_data):
- """
- Process the API response, filter for location keywords using spaCy, and sort by volume
- """
- all_keywords = []
-
- for post_id, post_data in response_data.items():
- if "ranked" in post_data:
- for keyword_data in post_data["ranked"]:
- all_keywords.append(keyword_data)
-
- # Filter and sort keywords using spaCy location detection only
- location_keywords, non_location_keywords = filter_and_sort_keywords_by_location(all_keywords)
-
- # Save results to file
- with open('results.json', 'w') as f:
- json.dump({
- 'location_keywords': location_keywords,
- 'non_location_keywords': non_location_keywords
- }, f, indent=2)
-
- return location_keywords
+
@app.route('/get_ranked_kw_for_domain', methods=['GET', 'POST'])
def get_ranked_keywords():