Files
dissertation/03_implementation/bak/03_knowledge_clusters.tex.bak

318 lines
32 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
% \section{Publication-Driven EU Call Matching}
% \section{Knowledge Clusters and Expertiese Matching}
In today’s research-driven academic landscape, aligning external project calls with the right university departments is a critical process, especially since these grants serve as a key source of funding to pursue academic research, support staff and doctoral students, acquire equipment, and sustain long-term research agendas. Universities, particularly in Europe, rely heavily on external funding mechanisms such as those provided by the European Union through programs like Horizon Europe. To secure such funding, academic departments (e.g., affiliations) must identify and respond to relevant project calls in a timely and accurate manner.
Currently, this matching process is predominantly manual. Academic staff must manually search through various funding portals, or rely on science support centers to review incoming calls and forward them to potentially relevant departments. This manual procedure involves browsing numerous project descriptions and comparing them against the thematic focus of departments, requiring significant effort. Effective matching also depends on a deep understanding of each department’s or researcher’s publication history to accurately identify expertise aligned with the call. These human-centered limitations make the process not only labor-intensive and time-consuming but also highly subjective and dependent on institutional knowledge, introducing risks such as overlooked opportunities, mismatches in research focus and high degree of repetitiveness. These problems can lead to risks such as proposal resubmissions, which increase the time required to prepare proposals and ultimately result in greater time wastage \cite{herbert2013time}.
To address these issues, this thesis proposes a data-driven approach leveraging Natural Language Processing (NLP) techniques, particularly topic modelling. Topic modelling can uncover latent thematic structures in large text corpora, such as academic publications and funding calls. By aligning the extracted research themes from departmental publications with those described in project calls, it becomes possible to automate and objectify the matching process. This approach not only saves time but also ensures a more consistent and scalable way of assigning calls to the most relevant academic units.
Matching external research funding calls to appropriate university departments poses several technical and organizational challenges. Funding calls are heterogeneous in structure: while some contain detailed descriptions of objectives and priorities, others offer only minimal or abstract information. Their language and formatting may vary across different funding agencies or programs, further complicating parsing and interpretation.
On the other hand, academic publications offer a consistent and reliable representation of a department’s or researcher's core expertise. Aggregating publication data enables the construction of thematic profiles for various organizational entities - be it faculties, institutes, chairs, or individual researchers. These profiles can serve as a reference framework for evaluating the relevance of external project calls.
However, existing approaches largely rely on manual review processes that suffer from a lack of objectivity and repeatability. Manual matching is also difficult to scale across large institutions and introduces delays in responding to funding opportunities. There is a clear need for an automated, transparent, and reproducible system that can perform this task efficiently and effectively.
We implement a web crawler capable of automatically retrieving current and upcoming project calls from publicly available funding portals.
We collect and process publication data from the university’s internal bibliography to model departmental expertise.
We train a topic modelling algorithm solely on the publication data to uncover thematic structures that represent the research focus of different departments.
We develop an automated matching mechanism that infers topic distributions for project calls and compares them to department profiles to assign relevant calls.
We evaluate the system using historical project calls and a selection of university publications to assess its effectiveness in terms of accuracy and practical applicability.
Through these contributions, this thesis provides a scalable and objective method for research call allocation that reduces manual workload and enhances the alignment between external funding and institutional research priorities.
\section{Requirements}
This chapter outlines the requirements and constraints for the implementation of a publication-driven matching system that assigns research funding calls to academic departments. The system aims to automate a traditionally manual and subjective process by using Natural Language Processing and topic modelling techniques to align funding calls with departmental research interests.
The core functional and non-functional requirements of the system are as follows:
\begin{itemize}
\item \textbf{Web Crawler for Funding Calls:} There must be implemented a web crawler to automatically extract open and forthcoming project calls from the EU Funding \& Tenders Portal. This includes parsing project titles, submission deadlines, topic areas, URLs, and descriptions.
\item \textbf{Publications Data Collection:} The publication data from the university’s internal bibliography must be collected and processed for further training. Author names must be mapped to their corresponding departments, which may include faculties, institutes, or chairs.
\item \textbf{Topic modelling on Publications:} An NLP pipeline must be implemented to perform topic modelling on the publication corpus. The model should identify key thematic structures that represent the research expertise of each department.
\item \textbf{Call Matching via Topic Similarity:} The system should infer the topic distribution of incoming project calls and match them to departmental topic profiles using a similarity metric (e.g., cosine similarity).
\item \textbf{Hierarchical Matching Capability:} The system should support matching at multiple organizational levels-from faculty down to individual researchers - based on the available publication data.
\item \textbf{Evaluation Framework:} The system must include a mechanism to evaluate its performance, using historical project calls with known departmental participation as ground truth where available.
\item \textbf{Interpretability:} The system should output interpretable results, including top-matching departments per call and, optionally, associated topic relevance scores.
\end{itemize}
\subsubsection{Constraints}
The development of the system is subject to several constraints, which affect both the design and implementation choices:
\begin{itemize}
\item \textbf{Data Inconsistency:} Funding calls published on the EU Funding Portal may vary significantly in structure and content. Some calls may lack detailed descriptions, making semantic analysis more difficult.
\item \textbf{Incomplete Metadata:} University publications may not include abstracts, which reduces the quality of topic modelling.
\item \textbf{Unlabeled Data:} There is no existing dataset of labeled matches between project calls and departments. As a result, the system must rely on unsupervised learning techniques, limiting the ability to directly optimize for accuracy.
\item \textbf{Indirect Affiliation Mapping Bias:}
The process of completing missing departmental affiliations in the publication dataset relies on crawling the LSF profiles of authors using their unique IDs. However, this information is not directly linked to individual publications, but rather to the author's most recent or current affiliations. As a result, the inferred department for a publication may not accurately reflect the author’s affiliation at the time of that publication, introducing a potential bias in the department assignment process.
\item \textbf{Computational Resources:} Topic modelling on large corpora of publication texts can be computationally expensive, especially when applied at scale across an entire university.
\end{itemize}
\section{Approach}\label{approach}
This chapter describes the design of a publication-driven matching system that processes academic publication data and matches research funding calls to recommend relevant departments. The system employs two distinct approaches, which are compared in terms of their ability to capture departmental research focus.
The first is \textbf{Unsupervised topic modeling}, which identifies thematic clusters within publications without prior labeling, uncovering latent research topics that can be associated with departments.
The second is \textbf{Supervised topic modeling}, which uses department labels to guide the model, training it to associate publications with the correct department. This allows the system to predict or retrieve the department most relevant to a given publication or funding call.
The overall workflow comprises acquiring funding calls data (\ref{sec:funding_calls}), collecting and refining publication records (\ref{sec:pub_data}), extracting topics or class-based features with topic modelling(\ref{sec:topic_modelling}), and computing similarity-based (unsupervised) or probability-based (supervised) recommendations to rank departments for each funding call.(\ref{sec:matching_calls}).
\subsubsection{Funding Calls}
\label{sec:funding_calls}
A \textbf{funding call} is an official invitation issued by a funding agency - such as the European Commission - for researchers, institutions, or organizations to submit project proposals for financial support. These calls are typically aligned with strategic research and innovation priorities and are designed to stimulate progress in specific scientific or societal domains. Funding calls are crucial for guiding research directions, fostering collaboration, and enabling the implementation of impactful projects across Europe and beyond. They are especially important for universities, as they provide essential financial resources to support academic research, attract top talent, build institutional capacity, and enhance the university’s visibility and impact within the global research community.
Funding calls published on the EU Funding \& Tenders Portal~\cite{eufundingtenders2025} typically include key metadata such as the call title, topic identifier, status (e.g., open, closed, forthcoming), opening and closing dates, a brief description of the call’s scope, and a link to a dedicated webpage with further information.
The EU Funding \& Tenders Portal hosts a wide range of funding calls, including open, closed, and forthcoming opportunities. For this case study, data as of 22 July 2025 is considered, focusing sexclusively on the Horizon Europe and Horizon 2020 Framework Programmes. At that time, a total of \textbf{6,822 EU calls} had been listed. Of these, \textbf{6,765 calls} were closed, \textbf{57 calls} were forthcoming, and \textbf{no calls} were open.
Figure~\ref{fig:call_example} shows an example of a call as displayed on the portal. While the structure is mostly consistent, it may vary slightly depending on the funding program.
\begin{figure}[h]
\centering
\includegraphics[scale=0.35]{figures/project-matcher/thesis/call.png}
\caption{Example of a funding call from the EU Funding \& Tenders Portal}
\label{fig:call_example}
\end{figure}
\subsubsection{Publications Data}
\label{sec:pub_data}
For this study, publication data from the \textbf{University of Duisburg-Essen} was selected to provide a comprehensive overview of the university's scholarly output. The university comprises \textbf{12 faculties} and approximately \textbf{500 chairs, institutes, and working groups}. Its internal bibliography records a total of \textbf{155,146 publications} \cite{uniduisburgessenbibliography} authored by a diverse community of researchers, including \textbf{512 professors} and \textbf{4,172 scientific employees} \cite{uniduisburgessenfacts2025}.
\subsubsection*{University Publications}
\label{subsec:uni_pubs}
Publication data are originated from the University of Duisburg-Essen's internal bibliography, which is a curated database that systematically collects and manages records of the university's scholarly output. This bibliography covers the years 2000 to 2024, including works published in both German and English. Each entry (Figure~\ref{fig:pub_example}) contains metadata such as the publication title, research area, authors, departmental affiliations (e.g., faculties, institutes, chairs), and abstracts. However, affiliation information and abstracts were often \textit{incomplete}.
\begin{figure}[h]
\centering
\includegraphics[scale=0.35]{figures/project-matcher/thesis/pub.png}
\caption{Example of a publication item from the university's internal bibliography}
\label{fig:pub_example}
\end{figure}
\subsubsection*{Departments Completion}
To address missing affiliation data—briefly mentioned in Subsection~\ref{subsec:uni_pubs} - author-specific identifiers (LSF ID) were extracted from publications lacking department mappings (Figure~\ref{fig:pub_empty}). These identifiers were then used to retrieve updated departmental information from individual staff profiles, obtained by querying the University’s personnel database.
A typical staff record (Figure~\ref{fig:lsf_person}) includes a university ID (LSF ID), personal and contact information, functions, and department affiliations - all of which are crucial for completing the affiliation data. The enriched department information was subsequently integrated back into the publication dataset. All records were stored in a searchable index to enable efficient querying, filtering, and retrieval.
\begin{figure}[h]
\centering
\includegraphics[scale=0.32]{figures/project-matcher/thesis/pub_empt2.png}
\caption{Example of a publication with missing abstract and department data}
\label{fig:pub_empty}
\end{figure}
\begin{figure}[h]
\centering
\includegraphics[scale=0.35]{figures/project-matcher/thesis/lsf_person.png}
\caption{Example of a person from the LSF Database}
\label{fig:lsf_person}
\end{figure}
\textit{Note: Due to variations and limited standardization in the university's web page structures, the affiliation chairs in the dataset may refer not only to actual chair positions but also to broader units such as working groups or, in some cases, entire institutes.}
\section{Topic Modelling of Publications}
\label{sec:topic_modelling}
To uncover thematic patterns in the publication corpus, two separate pipelines were applied, both trained on publications: \textbf{unsupervised topic modelling} and \textbf{supervised topic modelling}.
Dense \textbf{word and sentence embeddings} were used to represent each publication in a high-dimensional semantic space. The raw text was kept largely unchanged before embedding.
For the \textbf{unsupervised topic modelling}, dimensionality reduction and clustering were applied to group publication embeddings into clusters of semantically related content. Each cluster was interpreted as a topic, with representative keywords providing insight into the thematic structure of the corpus.
For the \textbf{supervised topic modelling}, the model was trained to predict predefined categories (e.g., departments or individual researchers) from publication embeddings. A classifier replaces the clustering step, allowing the model to learn topics aligned with known labels. This approach ensures that each publication is assigned to a relevant category based on its semantic representation.
\section{Departments Retrieval for Funding Calls}
\label{sec:matching_calls}
The system supports two matching modes:
In the first
\textbf{unsupervised mode} topics for the funding call are inferred using a topic model trained on publications. The assigned topics are ranked based on their probability, from highest to lowest. Relevance scores are then derived by taking the embedding of the funding call and computing its semantic similarity with the embeddings of publications within the predicted topic for the funding call, measuring how closely the funding call matches the thematic focus of the publications.
In the second
\textbf{supervised mode}, the system uses a Random Forest classifier to predict department probabilities directly from call embeddings. Departments are ranked by their predicted probabilities, from highest to lowest. The relevance score is derived directly from these class probabilities, and departments are ranked based on their predicted relevance to the funding call.
A higher score indicates a closer thematic match between the funding call and the corresponding publications or departments.
In \textbf{both modes}, the system outputs ranked department recommendations for each funding call, supporting various organizational levels and configurable \textit{top-$k$} results.
\section{Visual Pipeline}
Figure~\ref{fig:pipeline_overview} illustrates the end-to-end workflow of the publication-driven matching system. The pipeline is divided into three main phases: Collecting publications \& Training, Collecting funding calls \& Inference, and Department Retrieval separated in supervised and unsupervised approaches.
\begin{figure}[!h]
\centering
\includegraphics[scale=0.48]{figures/project-matcher/thesis/pipe_approachpng.png}
\caption{Comprehensive overview of the publication-driven matching system pipeline}
\label{fig:pipeline_overview}
\end{figure}
\textbf{\textit{I.}} In the \textbf{Collecting publications \& Training} phase, publication records are collected from the university bibliography and enriched with affiliation data from the personnel database. These records are stored in a publication database and used to train a topic model on \textbf{publication titles}.
\textbf{\textit{II.}} In the \textbf{Collecting Funding Calls \& Inference} phase, funding call information is continuously retrieved from the EU Funding \& Tenders Portal. Each call is semantically embedded and analyzed using the previously trained topic model to identify its underlying topics.
\textbf{\textit{III.}} Finally, in the \textbf{Department Retrieval} phase, the system matches funding calls to the most relevant university units.
In the \textbf{unsupervised department retrieval}, after the call embedding is analyzed by an unsupervised model and assigned to one or more topics (clusters), similarity scores between the call embedding and publication embeddings within those topics are computed. Publications are then ranked by semantic similarity, and the corresponding departments are retrieved from the top-ranked publications.
In the \textbf{supervised department retrieval}, the call embedding is analyzed by a supervised model that directly predicts the most relevant departments. Departments are retrieved based on their predicted probabilities of relevance, which are then used to rank them.
\section{Implementation}\label{implementation}
While the Approach chapter (Chapter~\ref{approach}) introduced the conceptual pipeline (Figure~\ref{fig:pipeline_overview}), this chapter presents its concrete realization. Figure~\ref{fig:pipeline_implementation} illustrates the implementation pipeline, in which each abstract component of the design is specified with the technologies, models, and data structures used in practice.
\begin{figure}[h]
\centering
\includegraphics[width=0.80\textwidth]{figures/project-matcher/thesis/pipe_implementation.png}
\caption{More detailed overview of the publication-driven matching system pipeline with implementation details}
\label{fig:pipeline_implementation}
\end{figure}
The pipeline follows the same three-phase structure as before: \textbf{Collecting Publications \& Training} - data collection is explained in Section~\ref{web_crawling}, and model training is detailed in Section~\ref{model_training}; \textbf{Collecting Funding Calls \& Inference} - data collection is described in Section~\ref{web_crawling}, and inference is presented in Section~\ref{subsec:scoring_ranking}; \textbf{Departments Retrieval} - discussed in Section~\ref{subsec:scoring_ranking}.
In contrast to the conceptual design, the implementation specifies concrete methods and tools: Selenium for data collection, Elasticsearch indices for storage and retrieval, and Random Forest, K-Means, and HDBSCAN for modelling. Additionally, cosine similarity is applied in the unsupervised branch to rank publications and retrieve departments.
\section{Acquisition of Publications and Funding Calls}\label{web_crawling}
\subsubsection{Web Crawling of Publications and Funding Calls}
To handle the dynamic and interactive nature of the EU Funding \& Tenders Portal and the university bibliography, two crawlers were implemented using \texttt{Selenium} \cite{selenium2025python} Python library, a browser automation framework capable of rendering JavaScript content and simulating user interactions. Both crawlers operate as follows:
A headless browser instance (e.g., ChromeDriver) is launched to minimize resource usage.
Then, the crawler accesses the funding call or university publication listing pages, iteratively navigating through pagination controls to retrieve all available entries.
For each entity, Selenium locates relevant HTML elements using XPath and CSS selectors to extract metadata fields such as call title and topic ID for funding calls, and title and department for publications. This approach enables targeted content crawling of portals that make extensive use of JavaScript and dynamic content loading.
\subsubsection{Data Storage with Elasticsearch}
The extracted metadata is stored in an \texttt{Elasticsearch}~\cite{elastic2025elasticsearch} cluster, a distributed search and analytics engine optimized for fast retrieval and full-text search capabilities.
Each funding call and publication is indexed as a JSON document, with fields corresponding to metadata attributes, enabling efficient querying and aggregation.
Elasticsearch’s distributed architecture allows scaling to accommodate increasing volumes of calls and publications.
Indexed data can be searched and filtered using Elasticsearch’s query DSL, enabling both full-text search and precise structured queries.
\textit{Note: Once the publications data was retrieved and indexed, it was parsed into a \texttt{pandas}\cite{pandas_2025} DataFrame for further processing.}
\subsubsection{Departments Completion}
Additionally, Selenium was employed to address incomplete affiliation data (departments) of publication records by navigating to researcher profile pages and extracting departmental or group affiliation information. The process operates as follows:
First, the list of unique LSF IDs is retrieved from the publications database, where department data is missing. Next, the corresponding URLs for each researcher’s profile page are constructed. Selenium is then used to load each profile page and extract affiliation details from the relevant HTML elements. Finally, the publication dataset is updated with the newly retrieved affiliation information for the corresponding records.
%%%%
\section{Topic Modelling of Publications}\label{model_training}
As mentioned in the approach, we apply topic modelling to train our models. For this purpose, BERTopic~\cite{grootendorst2022bertopic} was selected as the primary framework for topic modelling. This section outlines the experimental setup, including the rationale for selecting BERTopic (Section~\ref{subsec:why_bertopic_not_lda}), the BERTopic pipeline and its internal structure (Section~\ref{subsec:bertopic_pipeline}), and the clustering and assignment strategies (Section~\ref{subsec:clustering_strategies}).
\subsubsection{Why BERTopic Rather Than Traditional Approaches (LDA)}
\label{subsec:why_bertopic_not_lda}
\paragraph{Short texts and multilingual data.}
LDA~\cite{blei2003latent} operates on discrete token counts and relies on word co-occurrence patterns across documents. For short texts (titles) and multilingual corpora, co-occurrence information becomes sparse, often resulting in less coherent topics unless extensive preprocessing is applied. Transformer-based embeddings, as used in BERTopic, capture semantic similarity beyond lexical overlap, improving clustering quality and topic coherence.
\subsubsection{BERTopic Pipeline and Internal Structure}
\label{subsec:bertopic_pipeline}
BERTopic \cite{grootendorst2022bertopic} treats topic modelling as a problem of clustering and representation. The process begins by \textit{generating document embeddings from the inputs using a pre-trained language model}, with an optional step to \textit{reduce the dimensionality} of these embeddings. These embeddings are then clustered through clustering algorithms, or topics are assigned through a supervised classifier. Finally, \textit{interpretable topic descriptors are extracted} using a class-based TF-IDF (c-TF-IDF) procedure.
The technologies employed for each part of the pipeline are described below and shown on Figure~\ref{fig:bertopic_structure}:
\begin{figure}
\centering
\includegraphics[scale=0.6]{figures/project-matcher/thesis/BERTopic_pipe.png}
\caption{Parallel BERTopic pipelines: unsupervised clustering and supervised topic assignment.}
\label{fig:bertopic_structure}
\end{figure}
Transformer-based \textbf{Sentence-BERT embeddings}~\cite{reimers-2019-sentence-bert} were employed to generate dense semantic representations using the \textit{SentenceTransformers} library. Specifically, the pretrained \texttt{paraphrase-multilingual-mpnet-base-v2} model was utilized, which encodes input text - such as titles or keywords - into 768-dimensional vector embeddings. This model offers a strong balance between semantic accuracy and computational efficiency, while its multilingual capabilities make it well-suited for handling diverse, cross-lingual datasets.
To optimize the embedding space for clustering, \textbf{dimensionality reduction} is optionally applied using \texttt{UMAP}~\cite{mcinnes2020umapuniformmanifoldapproximation}. UMAP preserves both local and global structures, enhancing the quality of downstream topic modelling. This reduction step is integrated by default in the BERTopic framework.
On the reduced embeddings, \textbf{unsupervised clustering} (HDBSCAN, K-Means) or \textbf{supervised assignment} (Random Forest) strategies are applied, which are discussed in detail in Section~\ref{subsec:clustering_strategies}.
After the embeddings are clustered, \textbf{topic representation} is achieved through \textit{class-based TF-IDF} (c-TF-IDF), which relies on a \texttt{CountVectorizer} to convert clustered documents into token counts. Combined with the \texttt{KeyBERTInspired} model, this method extracts semantically relevant keywords for each cluster, ensuring that the topics are represented by labels that reflect the core meaning of the grouped texts~\cite{grootendorst2022bertopic}.
\subsubsection{Clustering and Assignment Strategies}
\label{subsec:clustering_strategies}
Three parallel BERTopic pipelines were implemented to assign topics to publications, reflecting both \textbf{unsupervised} and \textbf{supervised} approaches:
\textbf{HDBSCAN (unsupervised, density-based):}\label{subsec:HDBSCAN}
\textbf{HDBSCAN} \cite{HDBSCAN2025} automatically determines the number of clusters, handles varying density, and identifies outliers. It is particularly suitable for exploratory topic discovery when no labels are available. Publications are grouped into semantically coherent clusters, and representative keywords are extracted to provide insight into the thematic structure of the corpus. This approach allows identification of latent topics without prior knowledge of the departmental structure.\\
\textbf{K-Means (unsupervised, centroid-based):}\label{subsec:KMeans}
\textbf{K-Means} \cite{K-means} enforces a fixed number of clusters, which allows for consistent comparison across models with the same topic count. It is computationally efficient and works well when clusters are roughly spherical. Each publication is assigned to the nearest centroid in the embedding space, providing an alternative unsupervised perspective on topic organization.\\
\textbf{Random Forest (classifier-based):}\label{subsec:Supervised}
The supervised pipeline leverages historical publication–department mappings to assign publications to \textbf{predefined topics corresponding to departments}. A \textbf{Random Forest classifier} is trained on embeddings derived from publication text to predict these topic labels directly. This approach maintains semantic coherence while providing supervised predictions aligned with known departmental categories, complementing the unsupervised pipelines.\\
This design enables a comparison between unsupervised topic discovery and supervised topic assignment. The supervised pipeline leverages labeled data to predict department relevance while still preserving the topic-informed structure of the publications.
\section{Departments Retrieval for Funding Calls}
\label{subsec:scoring_ranking}
Once topics are assigned to each funding call, department relevance is determined using two parallel approaches.
For \textbf{unsupervised} pipelines based on \textbf{clustering} (HDBSCAN, K-Means), \textbf{cosine similarity}~\cite{scikit_learn_cosine_similarity_2025} between the call and the publications within the assigned topics is computed. Departments are then aggregated and ranked based on this similarity results. In the \textbf{supervised} Random Forest pipeline, department probabilities are \textbf{predicted directly} from the funding call embeddings using the trained classifier, which produces a ranking of the most relevant departments.
\subsubsection{Unsupervised Pipeline (HDBSCAN, K-Means)}
The following procedure is used in the unsupervised pipelines for topic modelling. Initially, each call is mapped to one or more topics using BERTopic’s \texttt{transform()} for hard assignment or \texttt{approximate\_distribution()} for soft assignment. In this process, only the most relevant topics per call are retained. The code for this is as follows:
\begin{verbatim}
# Hard assignment
topics, probs = topic_model.transform(call_representation)
# Soft assignment
topic_distr, _ = topic_model.approximate_distribution(call_representation)
\end{verbatim}
Once the topics are assigned, the next step is to retrieve candidate publications related to each retained topic. This is achieved by accessing BERTopic’s document information, iterating through the topics, and selecting the relevant documents for each one. The relevant code snippet is:
\begin{verbatim}
for topic_id in topics:
document_info = topic_model.get_document_info(train_inputs, df=df)
topic_docs = document_info.loc[document_info['Topic'] == topic_id]
\end{verbatim}
After the candidate publications are retrieved, the semantic similarity between the call embedding and each publication embedding is computed using \textbf{cosine similarity}. This allows for a measure of how closely related each publication is to the original call.\\
Finally, the publications are ranked based on their similarity scores, and the associated departments are aggregated. This aggregation results in a \textit{top $k$} list of unique departments, reflecting those most relevant to the given call.
\subsubsection{Supervised Pipeline (Random Forest)}
As said before, in the supervised BERTopic pipeline, departmental assignments for funding calls are determined directly from their semantic embeddings using a trained Random Forest classifier.\\
The procedure begins with encoding, where the funding call's textual representation is transformed into a dense embedding using the same multilingual SentenceTransformer model as in the unsupervised pipelines:
\begin{verbatim}
# encode call
call_embeddings = embedding_model.encode(call_representation,
convert_to_numpy=True)
\end{verbatim}
Once the embedding is obtained, it is passed to the trained Random Forest classifier. This classifier outputs a probability score for each possible department, indicating how likely each department is to be the correct match for the funding call:
\begin{verbatim}
# predict probabilities
probs = classifier.predict_proba(call_embeddings)
class_labels = classifier.classes_
\end{verbatim}
The next step involves ranking the department–probability pairs in descending order. From this ranked list, the \textit{top $k$} departments with non-zero probability are returned as the predicted matches for the funding call:
\begin{verbatim}
# rank and select top predictions
class_probs = list(zip(class_labels, probs))
class_probs.sort(key=lambda x: x[1], reverse=True)
top_preds = []
for label, prob in class_probs:
if prob > 0:
top_preds.append((id_to_ent[label], prob))
return top_preds[:top_k]
\end{verbatim}