<p>As you know, HPR asks for tags to be added to the episodes we contribute. These are intended to be used to produce some kind of improved topic search at some point in the future.</p>
<p>I find it difficult to decide what tags to add to my shows, and I expect many people feel the same way about it. Should I use common tags like <em>Linux</em> or does that not differentiate it enough? How many tags should I add, should the words be plural or singular?</p>
<p>We have recently been asked to contribute to the task of adding tags to previous shows, so it's very much a hot topic at the moment.</p>
<p>In thinking about this I wondered if there was a way in which existing tags could be represented in a visual way to help with the process of choosing and rationalising tags. It was the type of thought that occurs to you in the shower or while out for a walk.</p>
<p>In my last job I occasionally used a package called <a href="https://en.wikipedia.org/wiki/Graphviz" title="GraphViz">GraphViz</a> to generate graphical representations. I used it to generate a chart showing how the organisation (a university) was divided up into schools, departments, sections and so on in a hierarchical manner. I wondered if it could be used for this task.</p>
<p>I decided to use my currently preferred scripting language, Perl, and found there was a module which let me access GraphViz. I started putting together a <a href="https://hackerpublicradio.org/eps/hpr1816_tag_visualise.html" title="tag_visualise (HTML)">script</a>.</p>
<p>The script was created in an evening and is still rather rough. It performs a very simple query on the database to obtain the show numbers of shows with tags, their titles and their tags. It then uses a CSV parser to parse the tag list and builds a hash table indexed by tags, where the contents per tag are the show numbers that use this tag.</p>
<p>Having built this hash table it is used to generate GraphViz data by making each tag and each show number a <em>node</em> and joining them together.</p>
<p>Finally the script processes the graph to produce output in <a href="https://hackerpublicradio.org/eps/hpr1816_tag_visualise.svg" title="SVG output">SVG</a> format which is available to view.</p>
<p>Bear in mind that this is not a finished project - it may never be finished! The script may not be ideal. My understanding of GraphViz may be insufficient, and the rendering of the SVG may not be good (I got various results on different browsers).</p>
<p>However, you might find it interesting or even useful. Feedback on the idea is welcome.</p>
<h2 id="links">Links</h2>
<ul>
<li>GraphViz Wikipedia entry: <a href="https://en.wikipedia.org/wiki/Graphviz" class="uri">https://en.wikipedia.org/wiki/Graphviz</a></li>
<li>Graphviz website: <a href="https://graphviz.org/" class="uri">https://graphviz.org/</a></li>
<li>Perl script to visualise tags (HTML version): <a href="https://hackerpublicradio.org/eps/hpr1816_tag_visualise.html" class="uri">https://hackerpublicradio.org/eps/hpr1816_tag_visualise.html</a></li>
<li>Output from the <code>tag_visualise</code> script as an SVG file: <a href="https://hackerpublicradio.org/eps/hpr1816_tag_visualise.svg" class="uri">https://hackerpublicradio.org/eps/hpr1816_tag_visualise.svg</a></li>
</ul>