mirror of
https://github.com/fhswf/aki_prj23_transparenzregister.git
synced 2025-06-21 23:33:54 +02:00
Created pipeline to run ner sentiment and sql ingest (#314)
Created a dataprocessing pipline that enhances the raw mined data with Organsiation extractions and sentiment analysis prio to moving the data to the sql db. The transfer of matched data is done afterword. --------- Co-authored-by: SeZett <zeleny.sebastian@fh-swf.de>
This commit is contained in:
@ -92,7 +92,7 @@ def test_sentiment_pipeline_existing_sentiment(
|
||||
mock_collection.find.return_value = mock_documents
|
||||
|
||||
# Call the process_documents method
|
||||
sentiment_pipeline.process_documents("text", "use_spacy")
|
||||
sentiment_pipeline.process_documents("text", "spacy")
|
||||
|
||||
# Ensure that sentiment_spacy was called with the correct text
|
||||
mock_sentiment_spacy.assert_called_once_with("This is a positive text.")
|
||||
@ -124,7 +124,7 @@ def test_sentiment_pipeline_no_documents(
|
||||
sentiment_pipeline.news_obj.collection = mock_collection
|
||||
|
||||
# Call the process_documents method
|
||||
sentiment_pipeline.process_documents("text", "use_spacy")
|
||||
sentiment_pipeline.process_documents("text", "spacy")
|
||||
|
||||
# Ensure that sentiment_spacy was not called
|
||||
mock_sentiment_spacy.assert_not_called()
|
||||
@ -159,7 +159,7 @@ def test_sentiment_pipeline_with_spacy(
|
||||
mock_collection.find.return_value = mock_documents
|
||||
|
||||
# Call the process_documents method
|
||||
sentiment_pipeline.process_documents("text", "use_spacy")
|
||||
sentiment_pipeline.process_documents("text", "spacy")
|
||||
|
||||
# Ensure that sentiment_spacy was called with the correct text
|
||||
mock_sentiment_spacy.assert_called_once_with("This is a positive text.")
|
||||
@ -198,7 +198,7 @@ def test_sentiment_pipeline_with_transformer(
|
||||
mock_collection.find.return_value = mock_documents
|
||||
|
||||
# Call the process_documents method
|
||||
sentiment_pipeline.process_documents("text", "use_transformer")
|
||||
sentiment_pipeline.process_documents("text", "transformer")
|
||||
|
||||
# Ensure that sentiment_transformer was called with the correct text
|
||||
mock_sentiment_transformer.assert_called_once_with("This is a negative text.")
|
||||
|
Reference in New Issue
Block a user