{"id":1080,"date":"2018-02-26T09:11:27","date_gmt":"2018-02-26T14:11:27","guid":{"rendered":"http:\/\/haleyai.com\/wordpress\/?p=1080"},"modified":"2018-07-13T18:25:28","modified_gmt":"2018-07-13T23:25:28","slug":"are-vitamins-subject-to-sales-tax-in-california","status":"publish","type":"post","link":"http:\/\/haleyai.com\/wordpress\/2018\/02\/26\/are-vitamins-subject-to-sales-tax-in-california\/","title":{"rendered":"Are vitamins subject to sales tax in California?"},"content":{"rendered":"<p>What is the part of speech of &#8220;subject&#8221; in the sentence:<\/p>\n<ul>\n<li>Are vitamins subject to sales tax in California?<\/li>\n<\/ul>\n<p>Related questions might include:<\/p>\n<ul>\n<li>Does California subject vitamins to sales tax?<\/li>\n<li>Does California sales tax apply to vitamins?<\/li>\n<li>Does California tax vitamins?<\/li>\n<\/ul>\n<p>Vitamins is the direct object of the verb in each of these sentences, so, perhaps you would think &#8220;subject&#8221; is a verb in the subject sentence&#8230;<\/p>\n<p><!--more-->A colleague who is expert in such matters points out that if  &#8220;subject&#8221; was a verb, then it would be more correctly stated in the  passive using &#8220;subjected&#8221;.\u00a0 (It is certainly not the case that vitamins  subject.)<\/p>\n<p>In the English Resource Grammar (ERG), it turns out to be an adjective, which may seem counter-intuitive (as it did to me at first glance).<\/p>\n<p>It became more apparent when the <a href=\"http:\/\/haleyai.com\/wordpress\/linguist%e2%84%a2\/\">Linguist<\/a> prompted as follows after parsing the sentence without parts of speech (if so configured):<\/p>\n<p><a href=\"http:\/\/haleyai.com\/wordpress\/wp-content\/uploads\/subject-to-parts-of-speech.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1084\" title=\"subject to parts of speech\" src=\"http:\/\/haleyai.com\/wordpress\/wp-content\/uploads\/subject-to-parts-of-speech.png\" alt=\"\" width=\"379\" height=\"280\" srcset=\"http:\/\/haleyai.com\/wordpress\/wp-content\/uploads\/subject-to-parts-of-speech.png 379w, http:\/\/haleyai.com\/wordpress\/wp-content\/uploads\/subject-to-parts-of-speech-300x221.png 300w\" sizes=\"auto, (max-width: 379px) 100vw, 379px\" \/><\/a><\/p>\n<p>Note that there is no verbal part of speech in any of the 65 different lexical, syntactic, and semantic parses returned for this simple sentence.<\/p>\n<p>There is much about natural language that is confusing to machines, as demonstrated by the large number of parses for even such a simple sentence[1].<\/p>\n<p>Consider the parse that a <a href=\"https:\/\/en.wikipedia.org\/wiki\/Principle_of_maximum_entropy\" target=\"_blank\">maximum entry<\/a> model selected as &#8220;best&#8221;:<\/p>\n<p><a href=\"http:\/\/haleyai.com\/wordpress\/wp-content\/uploads\/subject-to-parse-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1083\" title=\"subject to parse 1\" src=\"http:\/\/haleyai.com\/wordpress\/wp-content\/uploads\/subject-to-parse-1.png\" alt=\"\" width=\"399\" height=\"390\" srcset=\"http:\/\/haleyai.com\/wordpress\/wp-content\/uploads\/subject-to-parse-1.png 399w, http:\/\/haleyai.com\/wordpress\/wp-content\/uploads\/subject-to-parse-1-300x293.png 300w\" sizes=\"auto, (max-width: 399px) 100vw, 399px\" \/><\/a><\/p>\n<p>Consider the original sentence with &#8220;subject to sales&#8221; as an adjectival phrase and &#8220;tax in california&#8221; as a noun phrase.\u00a0 The latter is clearly plausible and the machine is perfectly satisfied with something being subject to sales (as it would be with subject to tax).<\/p>\n<p>Once we clarify that &#8220;to tax&#8221; is not actually a prepositional phrase in this sentence, the highest ranking parse that survives looks like:<\/p>\n<p><a href=\"http:\/\/haleyai.com\/wordpress\/wp-content\/uploads\/subject-to-parse-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1085\" title=\"subject to parse 2\" src=\"http:\/\/haleyai.com\/wordpress\/wp-content\/uploads\/subject-to-parse-2.png\" alt=\"\" width=\"399\" height=\"390\" srcset=\"http:\/\/haleyai.com\/wordpress\/wp-content\/uploads\/subject-to-parse-2.png 399w, http:\/\/haleyai.com\/wordpress\/wp-content\/uploads\/subject-to-parse-2-300x293.png 300w\" sizes=\"auto, (max-width: 399px) 100vw, 399px\" \/><\/a><\/p>\n<p>From the machine&#8217;s standpoint, this is perfectly reasonable, but the meaning (i.e., the semantics) of this parse is wrong.\u00a0 We are not asking if some vitamins are in California, after all!<\/p>\n<p>There are many ways to disambiguate this sentence using the Linguist, but for the sake of concluding this article, let&#8217;s advise it that the noun phrase shown above is incorrect (since it does not include &#8220;in California&#8221;).<\/p>\n<p><a href=\"http:\/\/haleyai.com\/wordpress\/wp-content\/uploads\/subject-to-parse-3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1086\" title=\"subject to parse 3\" src=\"http:\/\/haleyai.com\/wordpress\/wp-content\/uploads\/subject-to-parse-3.png\" alt=\"\" width=\"399\" height=\"372\" srcset=\"http:\/\/haleyai.com\/wordpress\/wp-content\/uploads\/subject-to-parse-3.png 399w, http:\/\/haleyai.com\/wordpress\/wp-content\/uploads\/subject-to-parse-3-300x279.png 300w\" sizes=\"auto, (max-width: 399px) 100vw, 399px\" \/><\/a><\/p>\n<p>We confirm this parse and have only 4 remaining. Without going too far into the remaining subtleties, consider the following semantic &#8220;discriminants&#8221;:<\/p>\n<p><a href=\"http:\/\/haleyai.com\/wordpress\/wp-content\/uploads\/subject-to-discriminants-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1087\" title=\"subject to discriminants 1\" src=\"http:\/\/haleyai.com\/wordpress\/wp-content\/uploads\/subject-to-discriminants-1.png\" alt=\"\" width=\"784\" height=\"412\" srcset=\"http:\/\/haleyai.com\/wordpress\/wp-content\/uploads\/subject-to-discriminants-1.png 784w, http:\/\/haleyai.com\/wordpress\/wp-content\/uploads\/subject-to-discriminants-1-300x157.png 300w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><\/p>\n<p>Essentially, these parses are considering the ambiguity of &#8220;to&#8221; as part of the adjectival construction versus the possibility that it introduces a prepositional phrase, but such linguistic details are of little concern (i.e., we don&#8217;t have to be a linguist to see what choices make sense).<\/p>\n<p>After selecting the first adjectival above all ambiguity is resolved, as shown below in the fully &#8220;conflated&#8221; rendering of the logic of the question below.<\/p>\n<p><a href=\"http:\/\/haleyai.com\/wordpress\/wp-content\/uploads\/subject-to-logic.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1088\" title=\"subject to logic\" src=\"http:\/\/haleyai.com\/wordpress\/wp-content\/uploads\/subject-to-logic.png\" alt=\"\" width=\"710\" height=\"391\" srcset=\"http:\/\/haleyai.com\/wordpress\/wp-content\/uploads\/subject-to-logic.png 710w, http:\/\/haleyai.com\/wordpress\/wp-content\/uploads\/subject-to-logic-300x165.png 300w\" sizes=\"auto, (max-width: 710px) 100vw, 710px\" \/><\/a><\/p>\n<p>Details on this conflation are in the second patent listed at <a href=\"http:\/\/www.linkedin.com\/in\/haley \" target=\"_blank\">LinkedIn<\/a>.\u00a0 For our purposes, this representation is sufficient for a logic programming system to answer the question.<\/p>\n<hr \/>\n<p>[1] For the interested reader, unless the input tokens are tagged with parts of speech, the ERG considers all possible interpretations of the text given its extensive grammar and lexicon.\u00a0 A proper partial tagging of this sentence might be &#8220;Are vitamins subject\/ADJ to\/P tax\/N in\/P California?&#8221;, which resolves all the ambiguities displayed in the dialog shown above, in which case, the Linguist returns 22 parses.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>What is the part of speech of &#8220;subject&#8221; in the sentence: Are vitamins subject to sales tax in California? Related questions might include: Does California subject vitamins to sales tax? Does California sales tax apply to vitamins? Does California tax vitamins? Vitamins is the direct object of the verb in each of these sentences, so, &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/haleyai.com\/wordpress\/2018\/02\/26\/are-vitamins-subject-to-sales-tax-in-california\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Are vitamins subject to sales tax in California?&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,16],"tags":[783,5,779,529,487,784,527,781,214,528,782,785,780],"class_list":["post-1080","post","type-post","status-publish","format-standard","hentry","category-formal-logic","category-natural-language","tag-business-logic","tag-business-rules","tag-dismabiguation","tag-english-resource-grammar","tag-erg","tag-legal-ai","tag-linguist","tag-maximum-entropy","tag-nlp","tag-nlu","tag-parse-tree","tag-sales-tax","tag-semantic-interpretation"],"_links":{"self":[{"href":"http:\/\/haleyai.com\/wordpress\/wp-json\/wp\/v2\/posts\/1080","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/haleyai.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/haleyai.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/haleyai.com\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/haleyai.com\/wordpress\/wp-json\/wp\/v2\/comments?post=1080"}],"version-history":[{"count":6,"href":"http:\/\/haleyai.com\/wordpress\/wp-json\/wp\/v2\/posts\/1080\/revisions"}],"predecessor-version":[{"id":1500,"href":"http:\/\/haleyai.com\/wordpress\/wp-json\/wp\/v2\/posts\/1080\/revisions\/1500"}],"wp:attachment":[{"href":"http:\/\/haleyai.com\/wordpress\/wp-json\/wp\/v2\/media?parent=1080"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/haleyai.com\/wordpress\/wp-json\/wp\/v2\/categories?post=1080"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/haleyai.com\/wordpress\/wp-json\/wp\/v2\/tags?post=1080"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}