229 make all analyses available for reports #244
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request includes significant changes to the
backend
andnlp
modules to improve the NLP analysis capabilities and refactor the code for better maintainability. The main changes involve updating theNlpClient
to support parallel analysis requests and refactoring the input processing functions in thenlp
module.Backend Module Changes:
backend/src/api/report/generate.rs
: Updated thenlp_analysis
function to accept multiple analysis kinds and perform parallel analysis using the newanalyze_parallel
method. [1] [2] [3]backend/src/nlp/nlp_client.rs
: Added anapi_key
field toNlpClient
and updated theanalyze
method to use this key. Introduced a newanalyze_parallel
method to handle parallel analysis requests. [1] [2] [3] [4]NLP Module Changes:
nlp/src/main.py
: Refactored multiple analysis functions (get_sentiment
,get_language
,get_sarcasm
,get_keywords
,get_spam
,get_politics
,get_hate_speech
, andget_clickbait
) to use a newprocess_inputs
helper function for better code reuse and maintainability. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]