## 3 Material and Method
### Step 1: Text Pre-Processing and Key Phrases Extraction  
First, the posts in the discussion forum are downloaded in.txt format and are processed to extract the relevant information: the title, the main text and the key phrases. The same processing is performed on the student's query. The posts and the query present the following structure:  
Message no. <X>  
Sent by: <sender name> on <date>  Title: <title text>  -  <main text>The title and main text of the post were extracted directly from the query. First, all words were converted to lower case and accents were removed. Then, non-essential words such as determiners and prepositions were eliminated since they do not carry semantic meaning. Next, key phrase extraction was performed using natural language techniques. Key phrases represent a way of transforming unstructured information associated with the content of texts into structured information that summarizes such content. Therefore, they are very useful in information search and similarity analysis processes. Here we have applied elementary unsupervised information extraction techniques to extract these key phrases. For this, we have defined a regular expression that corresponds to the most common forms of noun and prepositional phrases in Spanish. These types of phrases are usually used to describe the concepts mentioned in the texts. Specifically, this regular expression, which has been used previously in other works [12], takes the following form:  
(NEG? JJ* (NN. *)+ JJ* IN)? JJ* (NN. *)+ JJ*  
In this expression, \"NEG\" represents a negation trigger such as \"no\", \"neither\" or \"without\", \"JJ\" represents an adjective, \"NN\" represents a noun and \"IN\" a preposition. The first part of the expression, up to the preposition tag IN, represents key phrases that begin with a prepositional phrase, as in [('algoritmo', 'NN'), ('de', 'IN'), ('busqueda', 'NN')] (algorithm of search). If this part does not appear, the expression shall consist of a noun phrase only, as in [('costes', 'NN'), ('teoricos', 'JJ')] (theoretical costs). The initial tag NEG represents negated concepts as in [('sin', 'NEG'), ('coste', 'NN'), ('adicional', 'JJ')] (without additional cost). The same pre-processing is performed over the different questions in the repository of past tests: the text is converted to lower case, accents are removed, empty and very frequent words are eliminated and key phrases are extracted. **Step 2: Text Representation and Similarity Calculation**  
We use three different approaches to compute similarity between the student's query and the questions and posts: using traditional bags of words, using key phrases and using word embeddings. 1. **Computing similarity using bags of words**. We calculate the similarity between the student's query and (1) all the questions in the test repository and (2) all the posts in the forums. We represent pre-processed texts as bags of words, which model the  
Figure 1: Recommender architecture. text as a multiset (bag) of its words, ignoring grammar and word order. We then calculate the Jaccard coefficient between the bags of words that represent each pair of texts. We have implemented and tested various similarity measures, including LIN and cosine distance. However, we have chosen to present the results obtained using the Jaccard coefficient as they have demonstrated the most favorable outcomes). The Jaccard coefficient is a measure of similarity between finite sample sets, defined as the size of the intersection divided by the size of the union of the sample sets:  
\[jaccard(x,y)=\frac{\mid x\cap y\mid}{\mid x\cup y\mid}=\frac{\mid x\cap y \mid}{\mid x\mid+\mid y\mid-\mid x\cap y\mid} \tag{1}\]  
In addition, we compute the similarity between the titles and the bodies (main text) for each post and query. Since the titles often contain the most important elements of the body section, we assign double weight to the similarity between titles. 2. **Computing similarity using key phrases**.