diff --git a/service/src/main/inse/university_ranking/service.py b/service/src/main/inse/university_ranking/service.py index 0bd2b823..112a2a6f 100644 --- a/service/src/main/inse/university_ranking/service.py +++ b/service/src/main/inse/university_ranking/service.py @@ -67,7 +67,7 @@ async def get_rankings( async def get_trend( topics: List[str] = Query(..., description="List of topics to analyze"), keywords: Optional[List[str]] = Query(None, description="List of raw keywords corresponding to topics"), - soft_search: bool = Query(True, description="True if using mapped topics, False if using raw keywords"), + fuzzy: bool = Query(True, description="True if using mapped topics, False if using raw keywords"), institutions: Optional[List[str]] = Query(None, description="List of OpenAlex Institution IDs"), countries: Optional[List[str]] = Query(None, description="List of country codes"), regions: Optional[List[str]] = Query(None, description="List of region identifiers"), @@ -77,7 +77,7 @@ async def get_trend( return await strategy.get_trend( topics=topics, keywords=keywords, - soft_search=soft_search, + fuzzy=fuzzy, institutions=institutions, countries=countries, regions=regions, diff --git a/service/src/main/inse/university_ranking/trend_strategies.py b/service/src/main/inse/university_ranking/trend_strategies.py index 96f511f4..fbab0724 100644 --- a/service/src/main/inse/university_ranking/trend_strategies.py +++ b/service/src/main/inse/university_ranking/trend_strategies.py @@ -26,7 +26,7 @@ class TrendStrategy(abc.ABC): self, topics: List[str], keywords: Optional[List[str]] = None, - soft_search: bool = True, + fuzzy: bool = True, institutions: Optional[List[str]] = None, countries: Optional[List[str]] = None, regions: Optional[List[str]] = None, @@ -83,7 +83,7 @@ class PublicationsTrendStrategy(TrendStrategy): self, topics: List[str], keywords: Optional[List[str]] = None, - soft_search: bool = True, + fuzzy: bool = True, institutions: Optional[List[str]] = None, countries: Optional[List[str]] = None, regions: Optional[List[str]] = None, @@ -242,7 +242,7 @@ class PublicationsTrendStrategy(TrendStrategy): topic_clauses = [] topic_filters = {} for idx, t in enumerate(topics): - if not soft_search and keywords and idx < len(keywords): + if not fuzzy and keywords and idx < len(keywords): kw_val = keywords[idx] clause = { "bool": { @@ -403,7 +403,7 @@ class AuthorsTrendStrategy(TrendStrategy): self, topics: List[str], keywords: Optional[List[str]] = None, - soft_search: bool = True, + fuzzy: bool = True, institutions: Optional[List[str]] = None, countries: Optional[List[str]] = None, regions: Optional[List[str]] = None, @@ -481,7 +481,7 @@ class AuthorsTrendStrategy(TrendStrategy): topic_clauses = [] topic_filters = {} for idx, t in enumerate(topics): - if not soft_search and keywords and idx < len(keywords): + if not fuzzy and keywords and idx < len(keywords): kw_val = keywords[idx] clause = { "bool": { @@ -609,7 +609,7 @@ class PatentsTrendStrategy(TrendStrategy): self, topics: List[str], keywords: Optional[List[str]] = None, - soft_search: bool = True, + fuzzy: bool = True, institutions: Optional[List[str]] = None, countries: Optional[List[str]] = None, regions: Optional[List[str]] = None, @@ -662,7 +662,7 @@ class ProjectsTrendStrategy(TrendStrategy): self, topics: List[str], keywords: Optional[List[str]] = None, - soft_search: bool = True, + fuzzy: bool = True, institutions: Optional[List[str]] = None, countries: Optional[List[str]] = None, regions: Optional[List[str]] = None, @@ -714,7 +714,7 @@ class NewsTrendStrategy(TrendStrategy): self, topics: List[str], keywords: Optional[List[str]] = None, - soft_search: bool = True, + fuzzy: bool = True, institutions: Optional[List[str]] = None, countries: Optional[List[str]] = None, regions: Optional[List[str]] = None, @@ -834,7 +834,7 @@ class AllTrendStrategy(TrendStrategy): self, topics: List[str], keywords: Optional[List[str]] = None, - soft_search: bool = True, + fuzzy: bool = True, institutions: Optional[List[str]] = None, countries: Optional[List[str]] = None, regions: Optional[List[str]] = None, @@ -848,10 +848,10 @@ class AllTrendStrategy(TrendStrategy): news_strat = NewsTrendStrategy() # Query UDE publications data only - pub_task = pub_strat.get_trend(topics, keywords, soft_search, institutions=[DEFAULT_INSTITUTION_ID]) - pat_task = pat_strat.get_trend(topics, keywords, soft_search) - proj_task = proj_strat.get_trend(topics, keywords, soft_search) - news_task = news_strat.get_trend(topics, keywords, soft_search) + pub_task = pub_strat.get_trend(topics, keywords, fuzzy, institutions=[DEFAULT_INSTITUTION_ID]) + pat_task = pat_strat.get_trend(topics, keywords, fuzzy) + proj_task = proj_strat.get_trend(topics, keywords, fuzzy) + news_task = news_strat.get_trend(topics, keywords, fuzzy) pub_res, pat_res, proj_res, news_res = await asyncio.gather(pub_task, pat_task, proj_task, news_task) diff --git a/webapp/src/app/modules/keywords-search/keywords-search.component.html b/webapp/src/app/modules/keywords-search/keywords-search.component.html index 3de176be..3c490f39 100644 --- a/webapp/src/app/modules/keywords-search/keywords-search.component.html +++ b/webapp/src/app/modules/keywords-search/keywords-search.component.html @@ -455,11 +455,3 @@ } } - - -@if (showVisualization() && selectedKeywords().length > 0) { -