From afc778bd7f2cd1e44a350ca8040de50cedcecec5 Mon Sep 17 00:00:00 2001 From: kian Date: Wed, 31 Jan 2024 19:35:34 +0100 Subject: [PATCH] update tests --- {tests => pdf_processing}/sample_pdf.pdf | Bin {tests => pdf_processing}/test_pdf_extractor.py | 8 +------- .../test_text_summarization.py | 8 +------- 3 files changed, 2 insertions(+), 14 deletions(-) rename {tests => pdf_processing}/sample_pdf.pdf (100%) rename {tests => pdf_processing}/test_pdf_extractor.py (91%) rename {tests => pdf_processing}/test_text_summarization.py (93%) diff --git a/tests/sample_pdf.pdf b/pdf_processing/sample_pdf.pdf similarity index 100% rename from tests/sample_pdf.pdf rename to pdf_processing/sample_pdf.pdf diff --git a/tests/test_pdf_extractor.py b/pdf_processing/test_pdf_extractor.py similarity index 91% rename from tests/test_pdf_extractor.py rename to pdf_processing/test_pdf_extractor.py index 250c239..d93645e 100644 --- a/tests/test_pdf_extractor.py +++ b/pdf_processing/test_pdf_extractor.py @@ -1,10 +1,4 @@ -import sys -print(sys.path) -sys.path.append('../') -print(sys.path) - - -from pdf_processing.preprocessing import convert_pdf_to_text +from preprocessing import convert_pdf_to_text input_pdf_path = 'tests/sample_pdf.pdf' result_text = convert_pdf_to_text(input_pdf_path) diff --git a/tests/test_text_summarization.py b/pdf_processing/test_text_summarization.py similarity index 93% rename from tests/test_text_summarization.py rename to pdf_processing/test_text_summarization.py index cf073d0..36d0e9a 100644 --- a/tests/test_text_summarization.py +++ b/pdf_processing/test_text_summarization.py @@ -1,10 +1,4 @@ -import sys -print(sys.path) -sys.path.append('../') -print(sys.path) - - -from pdf_processing.preprocessing import summarize_text +from preprocessing import summarize_text input_text = """Love encompasses a range of strong and positive emotional and mental states, from the most sublime virtue or good habit, the deepest interpersonal affection, to the simplest pleasure.[1] An example of this range of meanings is that the love of a mother differs from the love of a spouse, which differs from the love for food. Most commonly , love refers to a feeling of strong attraction and emotional attachment.[2] Love is considered to be both positive and negative, with its virtue representing human kindness, compassion, and affection—"the unselfish, loyal and benevolent concern for the good of another"—and its vice representing a human moral flaw akin to vanity , selfishness, amour-propre, and egotism, potentially leading people into a type of mania, obsessiveness, or codependency .[3] It may also describe compassionate and affectionate actions towards other humans, oneself, or animals.[4] In its various forms, love acts as a major facilitator of interpersonal relationships and, owing to its central psychological importance, is one of the most common themes in the creative arts.[5][6] Love has been postulated to be a function that keeps human beings together against menaces and to facilitate the continuation of the species.[7]""" result_summary = summarize_text(input_text)