Skip to content

Commit

Permalink
removed /v1/extract-keywords endpoint (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
HazalCiplak authored Jan 9, 2025
1 parent 1521e18 commit 0cf3ac6
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 22 deletions.
6 changes: 0 additions & 6 deletions spacy_keyword_extraction_api/api_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,6 @@ def create_api_router(
) -> APIRouter:
router = APIRouter()

@router.get('/v1/extract-keywords')
def extract_keywords(text: str) -> KeywordsResponseTypedDict:
return {
'keywords': keyword_extractor.get_extracted_keywords_for_text(text)
}

@router.post(
'/v1/batch-extract-keywords',
responses=EXAMPLE_BATCH_KEYWORDS_RESPONSES_BY_STATUS_CODE_DICT
Expand Down
10 changes: 0 additions & 10 deletions tests/unit_test/api_router_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,6 @@ def test_should_remove_duplicates(self):


class TestExtractKeyword:
def test_should_return_extracted_keywords(
self,
keyword_extractor: KeywordExtractor
):
client = create_test_client(keyword_extractor=keyword_extractor)
response = client.get('/v1/extract-keywords', params={'text': TEXT_1})
assert response.json() == {
'keywords': keyword_extractor.get_extracted_keywords_for_text(TEXT_1)
}

def test_should_return_batch_extracted_keywords(
self,
keyword_extractor: KeywordExtractor
Expand Down
6 changes: 0 additions & 6 deletions tests/unit_test/main_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,3 @@ def test_read_main():
client = TestClient(create_app())
response = client.get("/")
assert response.status_code == 200


def test_extract_keywords_endpoint_is_available():
client = TestClient(create_app())
response = client.get("/v1/extract-keywords", params={'text': 'some text'})
assert response.status_code == 200

0 comments on commit 0cf3ac6

Please sign in to comment.