{"word_count": 233, "character_count": 2096}
In this blog, we demonstrate how we can convert Inex Social Book Search corpus from xml format into Trec Collection format; this format is valid as input for Terrier (compatible with TRECCollection parser) where we can apply the DFR models for book retrieval.In our experimentation, we consider that the content of all tags in xml file is important for indexing; therefore we consider the whole xml file as one document identified by its isbn. Thus, we just need two tags instead of all tags in xml, the isbn (named isbn) and the whole content (named text) following this format:&#60;book&#62;&#60;isbn&#62;123&#60;/isbn&#62;&#60;text&#62;the content of first book&#60;/text&#62;&#60;/book&#62;&#60;book&#62;&#60;isbn&#62;124&#60;/isbn&#62;&#60;text&#62;the content of second book&#60;/text&#62;&#60;/book&#62;The following python code can make this conversion.datadest="inex collection path"for folds in os.listdir(datdir):os.mkdir(datadest+folds)trectxt=""for files in os.listdir(datdir+folds):if files.endswith(".xml"):content= open(datdir+"/"+folds+"/"+files,'r').read()soup = BeautifulSoup(content)texts = soup.findAll("book")for text in texts:isbn =texts[0].findAll("isbn")[0].getText()trectxt+="&#60;book&#62;\n&#60;isbn&#62;"+isbn+"&#60;/isbn&#62;\n"trectxt+="&#60;text&#62;"+' '.join(texts[0].findAll(text=True))+"&#60;/text&#62;\n&#60;/book&#62;\n"f=open(datadest+folds+"/"+folds+".xml","w")f.write(trectxt)f.close()Inex SBS corpus is composed of 2,8 million documents, distributed in 1100 folders, our script generates for each folder only one Trec formatted file which contains all xml files in this folder. In fact this processing is necessary for improving the execution time of Terrier indexing process.We have also tested some DFR models, the InL2 model gives fair results in comparison with other models participating at Inex SBS 2014 workshop, where this model has classified the second w.r.t the measure nDCG@10 the official evaluation measure for the workshop.The results of InL2 using all tags for indexing and retrieving processes :   nDCG@10MRRMAPR@10000,1280,2360,1010,441