<p>The idea is super cool! I think that option A will probably work fairly well if the posts are very formulaic, but it really isn't that exciting. </p>

<p>Option B, like you point out will need training data.</p>

<p>Option C, really isn't the right use case of an autoencoder to try to extract latent information and somehow get from unstructured data to structured classifications. </p>

<p>I'd like to throw my hat in the ring with option D, it combines some of all 3 (or at least B and C). I suggest using BERT (or some flavor of it, like RoBERTa) which pulls in some of option C, then throwing a simple classifier on top of it for prediction. Because we're using BERT we can make do with a very small dataset. A suggestion for classification, I would mask the location names (found using NER) and then do predictions. For example, "I'm going from LA to San Fran" (Spacy picks up both as GPE, I did some tests and it is actually surprisingly good at abbreviations) would become "I'm going from A to B", then have the prediction be A to B or B to A. This would reduce classes and allow multiple locations, if we had "A to B to C" it would be several classification problems: A to B, then B to C. You could then do the computation again, just changing masks (technically it requires n choose 4 computations, choosing the two highest activation, maybe throwing out reverses)</p>

<p>I would get the dataset by bootstrapping it using option A, or even better quickly entering it yourself (because we're using BERT it shouldn't require too much data).</p>

<p>As for paper recommendations, I'm just in love with BERT lately <a href="https://arxiv.org/pdf/1810.04805.pdf" rel="nofollow noreferrer">https://arxiv.org/pdf/1810.04805.pdf</a>. I'm really into political applications, so I thought TD Parse was awesome <a href="https://www.aclweb.org/anthology/E17-1046.pdf" rel="nofollow noreferrer">https://www.aclweb.org/anthology/E17-1046.pdf</a>. Tell me how this project goes!</p>
Practical approaches to structured data extraction from plain text: Looking for ideas & feedback
<p>I am member of a Facebook group for local ride shares. The group is specific for two cities and everything that is in-between, so the post are (mostly) as such:</p>
<ul>
<li><em>&quot;I'm gonna drive from city A to city Z tomorrow afternoon&quot;</em></li>
<li><em>&quot;Anybody wanna join from city Z -&gt; city A tonight&quot;</em></li>
<li><em>&quot;Tomorrow at 4 pm, I need to drive from city D to city Z&quot;</em></li>
</ul>
<p>So I've been thinking about possible ways to build a simple search engine for it where people can select a date/time and the direction where they need to go. I'm thinking that in the end, I would like to have a structured tuple such as <code>{start: 'city A', end: 'city Z', time: '15/04/2020 14:00'}</code>. (I'd probably get the date from the post metadata.)</p>
<p>I'm not that advanced in NLP/text mining techniques that could make it in production, so I'm looking for some input on my ideas here:</p>
<h3>Option a): A rule-based approach</h3>
<ul>
<li>Use a common NLP library like StanfordNLP</li>
<li>Build a classic pipeline with preprocessing (stop word removal, ...), POS tagging etc.</li>
<li>Annotate all cities that we know about and define synonyms for abbreviations</li>
<li>Create enough specific rules to cover most cases</li>
<li>Probably a solid baseline, but as always: Edge cases would most likely be tedious</li>
</ul>
<h3>Option b): Supervised Learning</h3>
<ul>
<li>Turn it into a classification problem with &quot;City A -&gt; Z&quot; and &quot;City Z -&gt; A&quot; being the classes</li>
<li>Problem 1: Need for a hand-labeled dataset</li>
<li>Problem 2: Sub-routes in-between city A and Z become difficult</li>
<li>Not really my favorite option</li>
</ul>
<h3>Option c): Unsupervised Learning</h3>
<ul>
<li>Use an Autoencoder to extract the useful information from the posts</li>
<li>No need for hand-labeling data</li>
<li>Ideally, the latent space representation would contain all the information I need</li>
</ul>
<p>Option c) is my favorite and also the technically most interesting option, but I just started reading about this topic. Some thoughts I have about it:</p>
<ul>
<li>How would I point the Autoencoder towards the information I'm specifically interested in?</li>
<li>I read that with variational Autoencoders, you can manually set the bottleneck &quot;thin enough&quot; so that the compressed code contains what you're looking for. Is this a trial-and-error process or is there any intuition behind it?</li>
<li>Is an Autoencoder even the right choice to do structured data extraction from text?</li>
<li>Do you see any alternative approaches that I might have missed?</li>
</ul>
<p>I would really appreciate some thoughts, comments and paper or book recommendations. With all the current down time, I'm hoping to do some hands-on work on this and get some more experience in unsupervised learning.</p>