lucasmoura’s blog

Another variable in the Deep Learning hyperspace

AppRecommender My Google Summer of Code Project

AppRecommender is a package recommender system for Debian. This project is also one of the Debian projects that is being worked on by some Google Summer of Code students. As one of these students, I will now present what my Google Summer of Code project is and what I have achieved so far.

First of all, my project is to allow AppStream to parse recommendations provided by AppRecommender. AppStream is a project that aims at providing cross-distribution metadata about components that can be installed by an user.

By allowing AppStream to parse AppRecommender recommendations, some software centers that use AppStream data would also be able to display recommendations provided by AppRecommender. This would be really good because AppRecommender works only via terminal access in this moment, which is a huge restriction for some users. Therefore, by allowing software centers to display recommendations to its users, a new kind of user would be covered by AppRecommender.

With that said, this is the representation of the 0ad component on AppStream:

<component type="desktop">
    <id>0ad.desktop</id>
    <pkgname>0ad</pkgname>
    <name>0 A.D.</name>
    <summary>A real-time strategy game of ancient warfare</summary>
    <summary xml:lang="it">Videogioco strategico in tempo reale di guerre
    antiche</summary>
    <icon type="cached">0ad.png</icon>
    <categories>
      <category>Game</category>
      <category>StrategyGame</category>
    </categories>
  </component>
  <component type="desktop">
    <id>0install.desktop</id>
    <pkgname>0install-core</pkgname>
    <name>0install</name>
    <summary>Run or manage Zero Install programs</summary>
    <summary xml:lang="es">Actualiza o quita programas de tu menĂº
    Aplicaciones</summary>
    <summary xml:lang="sv">Uppdatera eller ta bort Zero Install-program i
    menyn Program</summary>
    <description><p>Zero Install is a decentralised cross-distribution
    software installation system.</p><p>Features include full support for
    shared libraries (with a SAT solver for dependency resolution), sharing
    between users, and       integration with native platform package
    managers.</p><p>It supports both binary and source packages, and works on
    Linux, OS X, Unix and Windows systems. It is fully Open
    Source.</p></description>
    <icon type="cached">0install.png</icon>
    <categories>
      <category>PackageManager</category>
      <category>Settings</category>
      <category>System</category>
      <category>Utility</category>
    </categories>
    <url type="homepage">http://0install.net</url>
    <screenshots>
      <screenshot type="default">
        <image type="source" height="351"
        width="624">http://people.freedesktop.org/~mak/appstream/debian/screenshots/source/0install-22aeb5e8b09a96f2df0d3a8f79567aeb.png</image>
        <image type="thumbnail" height="351"
        width="624">http://people.freedesktop.org/~mak/appstream/debian/screenshots/624x351/0install-22aeb5e8b09a96f2df0d3a8f79567aeb.png</image>
        <image type="thumbnail" height="63"
        width="112">http://people.freedesktop.org/~mak/appstream/debian/screenshots/112x63/0install-22aeb5e8b09a96f2df0d3a8f79567aeb.png</image>
        <image type="thumbnail" height="423"
        width="752">http://people.freedesktop.org/~mak/appstream/debian/screenshots/752x423/0install-22aeb5e8b09a96f2df0d3a8f79567aeb.png</image>
      </screenshot>
    </screenshots>
    <languages>
      <lang percentage="88">de</lang>
      <lang percentage="63">es</lang>
      <lang percentage="100">sv</lang>
    </languages>
  </component>

With that idea in mind, I have been discussing with AppStream maintainers about this idea for quite some time. I have tried to implement some approaches, but so far, most of them are flawed. However, during DebConf I was able to talk directly with Matthias Klump, the maintainer of AppStream, about this issue, and we have thought about a possible solution.

The solution would be that an AppStream component would have a suggests tag that would indicate which recommendation where generated by that component. For example, given that the user has vim and git installed and AppRecommender recommends vim-fugitive, the vim component would have the following tag:

<component type="desktop">
    <id>vim.desktop</id>
    <pkgname>vim</pkgname>
    <name>Vim</name>
    <suggests type="heuristic">
      <id>vim-fugitive.desktop</id>
    </suggests>
</component>

Although a recommendation in AppRecommender is generated by a combination of user packages and not a single package, this approach may still work. That is because one of the strategies that will be implemented on AppRecommender is to recommend packages just after the user has installed a package. For example, if the user has installed a text editor, AppRecommender would them look at the user already installed packages and recommended packages related to both the already installed text editor and the other packages the user already has.

This new strategy could them be applied for every package the user has installed on the system, creating recommendations per package, which is exactly what this new format for AppStream is about.

There are still some discussion about this idea, but I believe that we are almost reaching a consensus about this new feature for AppStream :)