<?xml version="1.0" encoding="UTF-8"?>
<TEI xml:space="preserve" xmlns="http://www.tei-c.org/ns/1.0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.tei-c.org/ns/1.0 https://raw.githubusercontent.com/kermitt2/grobid/master/grobid-home/schemas/xsd/Grobid.xsd"
 xmlns:xlink="http://www.w3.org/1999/xlink">
	<teiHeader xml:lang="en">
		<fileDesc>
			<titleStmt>
				<title level="a" type="main">µRaptor: A DOM-based system with appetite for hCard elements</title>
			</titleStmt>
			<publicationStmt>
				<publisher/>
				<availability status="unknown"><licence/></availability>
			</publicationStmt>
			<sourceDesc>
				<biblStruct>
					<analytic>
						<author role="corresp">
							<persName><forename type="first">Emir</forename><surname>Muñoz</surname></persName>
							<email>emir.munoz@ie.fujitsu.com</email>
							<affiliation key="aff0">
								<orgName type="institution">National University of Ireland</orgName>
								<address>
									<settlement>Galway</settlement>
								</address>
							</affiliation>
						</author>
						<author>
							<persName><surname>Luca Costabello</surname></persName>
							<affiliation key="aff0">
								<orgName type="institution">National University of Ireland</orgName>
								<address>
									<settlement>Galway</settlement>
								</address>
							</affiliation>
						</author>
						<author>
							<persName><forename type="first">Pierre-Yves</forename><surname>Vandenbussche</surname></persName>
							<affiliation key="aff0">
								<orgName type="institution">National University of Ireland</orgName>
								<address>
									<settlement>Galway</settlement>
								</address>
							</affiliation>
						</author>
						<author>
							<persName><forename type="first">Fujitsu</forename><forename type="middle">Ireland</forename><surname>Limited</surname></persName>
							<affiliation key="aff0">
								<orgName type="institution">National University of Ireland</orgName>
								<address>
									<settlement>Galway</settlement>
								</address>
							</affiliation>
						</author>
						<title level="a" type="main">µRaptor: A DOM-based system with appetite for hCard elements</title>
					</analytic>
					<monogr>
						<imprint>
							<date/>
						</imprint>
					</monogr>
					<idno type="MD5">8B004ADABF6A27BB1C53ECBAF22A9616</idno>
				</biblStruct>
			</sourceDesc>
		</fileDesc>
		<encodingDesc>
			<appInfo>
				<application version="0.7.2" ident="GROBID" when="2023-03-24T22:07+0000">
					<desc>GROBID - A machine learning software for extracting information from scholarly documents</desc>
					<ref target="https://github.com/kermitt2/grobid"/>
				</application>
			</appInfo>
		</encodingDesc>
		<profileDesc>
			<abstract>
<div xmlns="http://www.tei-c.org/ns/1.0"><p>This paper describes µRaptor, a DOM-based method to extract hCard microformats from HTML pages stripped of microformat markup. µRaptor extracts DOM sub-trees, converts them into rules, and uses them to extract hCard microformats. Besides, we use co-occurring CSS classes to improve the overall precision. Results on train data show 0.96 precision and 0.83 F1 measure by considering only the most common tree patterns. Furthermore, we propose the adoption of additional constraint rules on the values of hCard elements to further improve the extraction.</p></div>
			</abstract>
		</profileDesc>
	</teiHeader>
	<text xml:lang="en">
		<body>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1">Introduction</head><p>In this paper we present our contribution to the Linked Data for Information Extraction Challenge<ref type="foot" target="#foot_0">1</ref> at the LD4IE 2014 Workshop. The challenge aims at using embedded structured data in web pages, e.g., RDFa, Microformats, or Microdata, to bootstrap and train supervised systems to extract structured data from the Web. Current web pages information extraction techniques focus on the (automatic) induction of wrappers to scrape meaningful parts (see <ref type="bibr" target="#b1">[2]</ref> for a survey). However, by extracting all the properties contained in hCards <ref type="foot" target="#foot_1">2</ref> , such techniques achieve low precision and recall. <ref type="bibr" target="#b0">[1]</ref> reports a F-score of 0.59 extracting person attributes from plain web pages. By relying on (X)HTML pages with hCard markup, µRaptor identifies hCard-like sections in (X)HTML documents without the need for hCard markup, and generates a corresponding RDF representation.</p><p>Extracting hCard information from (X)HTML pages presents two main challenges: 1) the identification of hCard sections in non semantically annotated (X)HTML pages, and 2) the qualification of hCard elements type (e.g. family-name, given-name). Our system addresses the two challenges by using the training document set to extract DOM sub-trees containing assessed hCard description and generating CSS selector rules. To increase the CSS selector rules precision, we generate a co-occurrence matrix of CSS classes and hCard properties. This also enhances the qualification of hCard property types. Furthermore, using value constraints rules associated to hCard properties, we assess the probability for an HTML element to be of a particular hCard type.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2">µRaptor System Description</head><p>Our system is composed of two distinct phases: The first phase aims at training the Information Extraction system (i.e. it learns the tree structures of hCard in the train set DOM); the second phase targets hCard semantic markup extraction. A flow diagram of our system is illustrated in Figure <ref type="figure" target="#fig_0">1</ref>. Moreover, the source code of µRaptor is publicly available at https://github.com/emir-munoz/uraptor, and works with the data provided in the Challenge website <ref type="foot" target="#foot_2">3</ref> .  2) CSS classes and hCard co-occurrence matrix computation. HTML elements annotated with hCard markup may also be annotated with other CSS classes. To achieve higher precision during the extraction phase, we compute a matrix of hCard element and other CSS class co-occurrences that will help refining the extraction rules and qualifying the hCard elements type.</p><p>3) DOM patterns, filtering, and conversion to CSS selectors. Once all hCard DOM sub-trees have been extracted, we count their frequencies. We keep only the most frequent patterns (thus achieving higher extraction precision) and convert them into rules to guide the extraction of hCards in other documents during the extraction phase. This conversion is done by transforming the extracted DOM sub-trees into CSS selectors<ref type="foot" target="#foot_3">4</ref> using the child combinator operator<ref type="foot" target="#foot_4">5</ref> . Since tree-like structures cannot be directly expressed with CSS selectors, we prune each DOM sub-tree, leaving only the longest path, and we convert such path to a chain of CSS child combinators (see example in Figure <ref type="figure">2</ref>). Co-occurring classes are used at this stage to increase the precision of the extraction rules. For instance, in the rule with selector "div &gt; img + cite" we found that the most common co-occurring class with vcard annotation is comment-author. Hence, we modify the rule to "div.comment-author &gt; img + cite". 4) hCard element value constraint rules extraction. Sometimes the extracted hCard microformats contain erroneous data (e.g. phone numbers in class="email" annotations). Although not implemented in the current µRaptor version, we propose to detect and fix such inconsistencies with a technique that we introduced in <ref type="bibr" target="#b2">[3]</ref>. Such strategy creates content patterns that can be used as constrains to validate hCard properties extraction. Fig. <ref type="figure">2:</ref> A sample DOM-subtree to CSS selector conversion.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.2">Extraction Phase</head></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>5) hCard DOM patterns detection.</head><p>During the extraction phase, we run each of the extracted rules over the test set of documents (containing no hCard markup) to identify hCard candidates. Rules are applied in a specific order: From the most long/specific to the most short/general, according to their CSS selectors. We add the constraint that only one rule will visit a hCard candidate. 6) hCard elements qualification. Once a DOM sub-tree containing a hCard candidate is extracted, we modify its DOM elements structure to add the corresponding hCard markup as captured during the training phase. In other words, we assign hCard properties such as vcard, fn, adr, email, and so forth, to elements in the DOM. Finally, we generate the N-Quads output file using Apache Any23<ref type="foot" target="#foot_5">6</ref> with the HTML document URI as graph name (context).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3">Results and Discussions</head><p>µRaptor evaluation (Figure <ref type="figure" target="#fig_1">1, step 7</ref>) was performed against the gold standard provided built using Apache Any23. We use Information Retrieval measures, namely Precision (P ), Recall (R) and F 1 -score to evaluate the performance of our system. Let be A = {gold standard n-quads}, and B = {µRaptor n-quads}, then</p><formula xml:id="formula_0">P = |A| \ |B| |B| , R = |A| \ |B| |A| ,<label>and</label></formula><formula xml:id="formula_1">F 1 = 2P R P + R</formula><p>We report our results over training and testing data in Table <ref type="table" target="#tab_0">1</ref>. A higher recall can be reached by adding more rules at the cost of overfitting the system. During our analysis, the first interesting observation is that the occurrences of hCard properties in the training dataset follow a logarithmic distribution (see Figure <ref type="figure" target="#fig_2">3</ref>). Aside from rdf:type (that occurs in 35.2% of cases), the most popular properties are vcard:n (16.5%), vcard:fn (10.2%), vcard:given-name (10.1%), vcard:family-name (9.9%). The remaining properties account for a 18.1% and consists in the long tail of the distribution (e.g. vcard:role occurs 32 times only, vcard:honorific-prefix only once). To extract the latest properties, we could define specific rules to extract the less frequent cases. However, we did not consider less frequent cases, thus a↵ecting our overall recall. This has been observed in the results given by the Challenge organizers after evaluation over the test set. Less frequent properties are not found by the current set of rules, adversely a↵ecting the overall recall. Again, µRaptor can easily be extended with more rules to cover those cases improving the performance of the system. Surprisingly, we notice that the gold standard provided for the challenge does not include a number of hCard microformats, due to an Apache Any23 inability to detect a certain number of them while parsing (X)HTML pages (however, the extraction is successful if only the HTML snippet is provided). For instance, the following microformat<ref type="foot" target="#foot_6">7</ref> in train1 dataset has not been extracted:</p><p>&lt; span class = " post -author vcard " &gt; Posted by &lt; span class = " fn " itemprop =" author " itemscope =" itemscope " itemtype =" http :// schema . org / Person " &gt; &lt; meta content = " https :// plus . google . com /117423557913834377613 " itemprop =" url " &gt; &lt;a href = " https :// plus . google . com /117423557913834377613 " rel = " author " title = " author profile " &gt; &lt; span itemprop =" name " &gt; Bianca Swanepoel &lt;/ span &gt; &lt;/a &gt; &lt;/ span &gt; &lt;/ span &gt; µRaptor, on the other hand, extracts more RDF n-quads than the gold standard, thus a↵ecting the precision (we attribute this to the preliminary (X)HTML pages cleaning, Figure <ref type="figure" target="#fig_0">1</ref>, step 1). The cleaning phase removes non relevant and noisy parts in the (X)HTML allowing a better extraction. A manual inspection found that our "extra" N-Quads are valid extractions.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4">Conclusion</head><p>µRaptor is a rule-based system that extracts structured information such as hCards, relying on (X)HTML pages DOM model. By considering only the 30 most frequent tree patterns for hCards (out of ca. 700), we achieved 0.94 of average precision. Experiments determined that adding few more rules produces a marginal di↵erence in F 1 -measure. Despite our approach performs well on training and testing data, µRaptor does not cover all hCard properties, since not all of them are used by web designers or content management systems (e.g., Drupal), making challenging to extract patterns to identify them.</p></div><figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_0"><head>Fig. 1 :</head><label>1</label><figDesc>Fig. 1: µRaptor system architecture with training and evaluation parts.</figDesc><graphic coords="2,173.77,256.95,247.71,185.79" type="bitmap" /></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_1"><head>2. 1</head><label>1</label><figDesc>Training Phase 1) hCard DOM sub-trees extraction. The training phase of our system takes as input the training set composed of 9,386 HTML documents containing hCard semantic markup. First, we clean the input HTML pages by removing all non-content related tags (e.g., style, JavaScript). Then, for each document, hCard sections are extracted using the [class*=vcard] CSS selector, returning sub-trees of the original DOM tree containing the hCard markup.</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_2"><head>Fig. 3 :</head><label>3</label><figDesc>Fig. 3: Properties occurrences in training data (note the logarithmmic scale).</figDesc><graphic coords="4,158.29,489.77,278.68,154.25" type="bitmap" /></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" type="table" xml:id="tab_0"><head>Table 1 :</head><label>1</label><figDesc>µRaptor results achieved in datasets.</figDesc><table><row><cell>Dataset</cell><cell>P</cell><cell>R</cell><cell>F1</cell></row><row><cell>Train</cell><cell>0.96</cell><cell>0.73</cell><cell>0.83</cell></row><row><cell>Test</cell><cell>0.92</cell><cell>0.67</cell><cell>0.77</cell></row><row><cell>Average</cell><cell>0.94</cell><cell>0.7</cell><cell>0.8</cell></row></table></figure>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="1" xml:id="foot_0">http://data.dws.informatik.uni-mannheim.de/LD4IE/</note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="2" xml:id="foot_1">http://microformats.org/wiki/hcard. A microformat used for publishing, people, companies, and organizations on the Web, using vCard properties.</note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="3" xml:id="foot_2">http://data.dws.informatik.uni-mannheim.de/LD4IE/data/</note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="4" xml:id="foot_3">http://www.w3.org/TR/css3-selectors/</note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="5" xml:id="foot_4">http://www.w3.org/TR/css3-selectors/#child-combinators</note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="6" xml:id="foot_5">http://any23.org</note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="7" xml:id="foot_6">Snippet included in http://www.themigratingswans.blogspot.ie/2013/12/ december-3.html</note>
		</body>
		<back>

			<div type="acknowledgement">
<div xmlns="http://www.tei-c.org/ns/1.0"><p>Acknowledgments. This work has been supported by KI2NA project funded by Fujitsu Laboratories Limited and Insight Centre for Data Analytics at NUI Galway (formerly known as DERI Galway).</p></div>
			</div>

			<div type="references">

				<listBibl>

<biblStruct xml:id="b0">
	<analytic>
		<title level="a" type="main">Person attribute extraction from the textual parts of web pages</title>
		<author>
			<persName><forename type="first">T</forename><forename type="middle">István</forename><surname>Nagy</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">Acta Cybern</title>
		<imprint>
			<biblScope unit="volume">20</biblScope>
			<biblScope unit="issue">3</biblScope>
			<biblScope unit="page" from="419" to="439" />
			<date type="published" when="2012-08">Aug. 2012</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b1">
	<monogr>
		<author>
			<persName><forename type="first">B</forename><surname>Liu</surname></persName>
		</author>
		<title level="m">Web Data Mining: Exploring Hyperlinks, Contents, and Usage Data. Data-Centric Systems and Applications</title>
				<imprint>
			<publisher>Springer</publisher>
			<date type="published" when="2011">2011</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b2">
	<analytic>
		<title level="a" type="main">Learning Content Patterns from Linked Data</title>
		<author>
			<persName><forename type="first">E</forename><surname>Muñoz</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">Linked Data for Information Extraction (LD4IE) Workshop, ISWC. CEUR</title>
				<imprint>
			<date type="published" when="2014">2014</date>
		</imprint>
	</monogr>
</biblStruct>

				</listBibl>
			</div>
		</back>
	</text>
</TEI>
