<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Julio Bonis on Medium]]></title>
        <description><![CDATA[Stories by Julio Bonis on Medium]]></description>
        <link>https://medium.com/@drbonis?source=rss-c3092815bd6e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*h2PezLMBzFUCu-hSE3Ejyw.jpeg</url>
            <title>Stories by Julio Bonis on Medium</title>
            <link>https://medium.com/@drbonis?source=rss-c3092815bd6e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 12:59:57 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@drbonis/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[A cognitive search engine and question answering system using SparkNLP.]]></title>
            <link>https://medium.com/spark-nlp/a-cognitive-search-engine-and-question-answering-system-using-sparknlp-and-t5-b3902e5f7586?source=rss-c3092815bd6e------2</link>
            <guid isPermaLink="false">https://medium.com/p/b3902e5f7586</guid>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[spark-nlp]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[question-answering]]></category>
            <dc:creator><![CDATA[Julio Bonis]]></dc:creator>
            <pubDate>Mon, 19 Jul 2021 09:57:01 GMT</pubDate>
            <atom:updated>2021-08-06T08:15:21.558Z</atom:updated>
            <content:encoded><![CDATA[<p>In the masterpiece science fiction novel from Adam Douglas titled “The Hitchhiker’s Guide to the Galaxy” a “group of hyperdimensional and very smart beings” build an enormous supercomputer named Deep Thought and ask it the “<a href="https://en.wikipedia.org/wiki/Phrases_from_The_Hitchhiker%27s_Guide_to_the_Galaxy#Answer_to_the_Ultimate_Question_of_Life,_the_Universe,_and_Everything_(42)">Answer to the Ultimate Question of Life, the Universe, and Everything</a>”. The Deep Thought, after fiting some models during 7.5 million years reveals the answer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*z6lLsCzNCjjrllX2u7jEtA.png" /><figcaption>This is Deep Thought after 7.5 million years of thinking about the answer to the ultimate question</figcaption></figure><p>The idea of being able to ask a computer a question in natural language, allow the computer to read tons of information and obtain an answer (hopefully accurate) in natural language as we can see, is not new.</p><p>In the following article I will guide you through a not-so-complex approach to implement a proof of concept of such a system applied to my particular field of interest: healthcare.</p><p>We will use the content from MedlinePlus, a public domain content developed by the US National Library of Medicine containing information for patients about 1000 health topics that you can find <a href="https://medlineplus.gov/">here</a> and download <a href="https://medlineplus.gov/xml.html">here</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/330/1*Fl98ObJAxbBYDafhQq8IMg.png" /></figure><p>All the code of this article can be run from a Google Colab and downloaded from a public <a href="https://github.com/JohnSnowLabs/spark-nlp-workshop/tree/master/tutorials/blogposts/medium/cognitive-search">GitHub repo</a>. You can also run the code over <a href="https://colab.research.google.com/github/JohnSnowLabs/spark-nlp-workshop/blob/medium-cognitive-search/tutorials/blogposts/medium/cognitive-search/medlineplus_sparknlp.ipynb">Google Colab</a>. We will use python, sparknlp (3.0.3) and some additional functions from pyspark (3.0.1). Lets go for it!</p><h3>Imports and spark session initialization.</h3><p>The first cell in the Google Colab is a bash script that installs a full Spark NLP + PySpark environment in your notebook:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4bf766eae263ac9ba4e2f28940360830/href">https://medium.com/media/4bf766eae263ac9ba4e2f28940360830/href</a></iframe><p>To run this code outside Colab you will need to install Spark NLP in your own environment. More information about this process at <a href="https://nlp.johnsnowlabs.com/docs/en/install">Spark NLP installation guideline</a>.</p><p>As usual we start from the begining, importing the required packages.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/37374d409204aff5680c90e133021800/href">https://medium.com/media/37374d409204aff5680c90e133021800/href</a></iframe><p>Next step is to start the spark session including sparknlp library jar by running:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ba655afc99e24ebca8ba070c7df76025/href">https://medium.com/media/ba655afc99e24ebca8ba070c7df76025/href</a></iframe><p>Notice we are using the flag gpu=True<em> </em>so we need to setup the Google Colab environment to a GPU like. You can also run this code in a machine without GPU support just by setting<em> </em><em>gpu=False .</em>See <a href="https://nlp.johnsnowlabs.com/docs/en/quickstart">Spark NLP documentation</a> for more information about this.</p><h3>Download corpus and first basic preprocessing with Spark.</h3><p>We will use MedlinePlus content, that is publicy available and contains high quality information about 1000 health topics targeted to patients. The original source is served in XML format but for the sake of simplifying this tutorial I have cleaned and extracted it in a <a href="https://github.com/JohnSnowLabs/spark-nlp-workshop/blob/master/tutorials/blogposts/medium/cognitive-search/corpus/mplus_topics_2021-06-01.txt">csv file</a>. The following line will download it from the Github repo and save in Google Colab disk:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/98b84ca9d0a4724463a6faecabf7bd36/href">https://medium.com/media/98b84ca9d0a4724463a6faecabf7bd36/href</a></iframe><p>The next step is to load this csv file into a Spark DataFrame by:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cfc6b9eb11f01efdd22c2b8eb97db1e7/href">https://medium.com/media/cfc6b9eb11f01efdd22c2b8eb97db1e7/href</a></iframe><p>If you run a medlineplusDF.show(5) you can see the first 5 rows of the new DataFrame:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/689/1*0AXmA-8gDHk-nI4B5DnMKQ.png" /></figure><p>We have the title, the original url, a brief text with a meta-description and the text published in MedlinePlus as summary.</p><p>If we want our system to find answers to the questions of the users we probably want it to search in the metadescription and also in the summary so we will concatenate both columns in a single “text” column with this pyspark command:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/45f3fc3d26d1a02adf0569af76befc9b/href">https://medium.com/media/45f3fc3d26d1a02adf0569af76befc9b/href</a></iframe><p>We are using here the general pyspark.sql.functions concat() , col() and lit()and creating a new column text with .withColumn()function.</p><h3>Spark NLP pipelines: where the magic begins.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/626/1*eMG7JlF0pKtlw5aEtBEyHg.jpeg" /><figcaption>By the way if you want to extract the handwriting of this book you could take a look to the SparkOCR library also from the creators of SparkNLP</figcaption></figure><p>If we want that our particular “Deep Thought” is able to answer the question (hopefully in less time than 7.5 million years of AWS EC2 GPU billable time) we need to think about some method that allows our system to “represent” the meaning of the question and the meaning of each of the sentences of the MedlinePLus content.</p><p>We will use the SparkNLP opensource components to solve that challenge.</p><p>SparkNLP works around the concept of pipelines, that are composed by a sequence of “annotators” (models that you need to train somehow) or “transformers” (those are algorithms non-trained, basically rule-based).</p><p>In our project we will use the following SparkNLP components:</p><p><strong>DocumentAssembler:</strong> a simple transformer that gets a column with text and represent it in a structured data model required by the rest of SparkNLP annotators. For example it adds some metadata as begin and end of a document (its character length). You can see how we specify the input column that this component will use to get the content .setInputCol(“text”) and the name of the column that will create .setOutputCol(“document”).</p><pre>docass = DocumentAssembler()\<br>    .setInputCol(&quot;text&quot;)\<br>    .setOutputCol(&quot;document&quot;)</pre><p><strong>SentenceDetectorDLModel:</strong> a deep-learning based model (so an annotator) that splits a text into sentences (not a trivial challenge for computers). In this case we will use a “pretrained” model already trained by JohnSnowLabs and freely available by using .pretrained() function.</p><pre>sentence_detector_dl = SentenceDetectorDLModel\<br>    .pretrained(&quot;sentence_detector_dl&quot;, &quot;xx&quot;)\<br>    .setInputCols([&quot;document&quot;])\<br>    .setOutputCol(&quot;sentence&quot;)</pre><p><strong>UniversalSentenceEncoder:</strong> a model that will transform a given sentence into an vector (embedding) of 512 float numbers in such a way that sentences with a similar meaning (even in different languages, thus the “universal”) will have similar vectors. The <a href="https://tfhub.dev/google/universal-sentence-encoder/4">Universal Sentence Encoder model</a> has been kindly pretrained by Google and integrated in SparkNLP by JohnSnowLabs.</p><pre>emb_use = UniversalSentenceEncoder.pretrained(&quot;tfhub_use_multi&quot;, &quot;xx&quot;)\<br>    .setInputCols(&quot;sentence&quot;)\<br>    .setOutputCol(&quot;use_embeddings&quot;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Na0jdXipJq9rmwkzcM_OVg.png" /><figcaption>Universal Sentence Encoder transform any sentence into a vector of float numbers that captures the semantic representation of that sentence.</figcaption></figure><p>Once we load and define the three components we will ensemble together into a Spark Pipeline, fit the pipeline to create a model_use, and then apply that pipeline to our medlineplusDF dataframe to transform it into a new dataframe named medlineplusSentencesDF.</p><pre># Create the pipeline<br>pipeline_use = Pipeline(<br>    stages=[<br>        docass, <br>        sentence_detector_dl, <br>        emb_use<br>        ]<br>    )</pre><pre># Fit (or prepare) the pipeline into a model<br>model_use = pipeline_use.fit(medlineplusDF)</pre><pre># Apply the model to our medlineplusDF content and save in a new dataframe<br>medlineplusSentencesDF = model_use.transform(medlineplusDF)</pre><p>Now if we show that new melineplusSentencesDF we see some columns have been created containing the output of the different Spark NLP annotators and transformers: document , sentence and use_embeddings .</p><pre>medlineplusSentencesDF.show(5)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qsg91dwDu9nvn7jTdzubWg.png" /><figcaption>The medlineplusSentencesDF, the output is not very usefriendly but we will fix that in a minute.</figcaption></figure><p>The next step to work easily with the result of running the Spark NLP Pipeline is to do some Spark transformations. The following code could seem some cryptic to you if you are not used to work with Spark but dont be scared.</p><p>Spark NLP will store all the sentences of a given document in a single row inside the sentence column. The same for the “embeddings” of each sentence. It will also store some “metadata” as the begining and the end of each sentence within the document.</p><p>First step is to put each sentence in a different row with the Spark function explode() and get for each sentence its correspondent embeddings with the array_zip() function. For each of these sentences we keep the original title and url.</p><p>All those transformations are achieved with this piece of code (believe it or not):</p><pre>medlineplusSentencesDF = medlineplusSentencesDF.select(<br>  F.col(&quot;title&quot;),<br>  F.col(&quot;url&quot;),<br>  F.arrays_zip(<br>    F.col(&quot;sentence.result&quot;).alias(&quot;sentence&quot;),<br>    F.col(&quot;sentence.begin&quot;).alias(&quot;begin&quot;),<br>    F.col(&quot;sentence.end&quot;).alias(&quot;end&quot;),<br>    F.col(&quot;use_embeddings.embeddings&quot;)<br>  ).alias(&quot;zip&quot;)<br>).select(<br>  F.col(&quot;title&quot;),<br>  F.col(&quot;url&quot;),<br>  F.explode(F.col(&quot;zip&quot;)).alias(&quot;zip&quot;)<br>).select(<br>  F.col(&quot;title&quot;),<br>  F.col(&quot;url&quot;),<br>  F.col(&quot;zip&quot;)[&#39;0&#39;].alias(&quot;sentence&quot;),<br>  F.col(&quot;zip&quot;)[&#39;1&#39;].alias(&quot;begin&quot;),<br>  F.col(&quot;zip&quot;)[&#39;2&#39;].alias(&quot;end&quot;),<br>  F.col(&quot;zip&quot;)[&#39;3&#39;].alias(&quot;embeddings&quot;)<br>)</pre><p>As a final step, to be able to use some Spark Machine Learning components, we need to cast the embeddings columns schema provided by Spark NLP (an array of floats) to a DenseVector type by using a “User Defined Function”:</p><pre>myudf = F.udf(lambda vs: Vectors.dense(vs), VectorUDT())</pre><pre>medlineplusSentencesDF = medlineplusSentencesDF.select(<br>  &quot;title&quot;, <br>  &quot;url&quot;, <br>  &quot;sentence&quot;, <br>  &quot;begin&quot;, <br>  &quot;end&quot;, <br>  myudf(&quot;embeddings&quot;).alias(&quot;embeddings&quot;)<br>)</pre><p>Finally after all those transformation we have a dataframe ready to do some “AI magic”. If you are still here is because you have what is needed to be a successful data scientist: patience.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*xEXif44IrzxlGl5fe-NjDA.jpeg" /><figcaption>Credits <a href="https://devrant.com/rants/2161326/rant">https://devrant.com/rants/2161326/rant</a></figcaption></figure><p>This is what we get with medlineplusSentenceDF.show(5):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tJTeElAB2ac-L1WA6na6xg.png" /><figcaption>Getting this table took 80% of this article and will take 80% of your time working in the “sexiest job of XXI century”</figcaption></figure><h3>The needle in the haystack</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*PBgz-5JOJtt7yxyd-5prFg.jpeg" /></figure><p>Now we have all the sentences in MedlinePlus organized and represented by an array of float numbers. However we don’t know which kind of question will our “group of hyperdimensional and sometimes not so smart beings” (a.k.a. “users”) will want to ask to our system. We need a way to represent what the question of our user (expressed in natural language) means.</p><p>Of course the answer is to apply the same pipeline that we used to generate the embeddings of the original content to the user’s question. We can do that with this code:</p><pre>def get_key(query, model):<br>  queryDF = spark.createDataFrame([[query]]).toDF(&quot;text&quot;)<br>  queryDF = model.transform(queryDF)<br>  queryDF = queryDF.select(<br>    F.explode(<br>      F.arrays_zip(<br>        F.col(&quot;sentence.result&quot;),<br>        F.col(&quot;use_embeddings.embeddings&quot;)<br>      )<br>    ).alias(&quot;zip&quot;)<br>  ).select(<br>    F.col(&quot;zip&quot;)[&#39;0&#39;].alias(&quot;sentence&quot;),<br>    myudf(F.col(&quot;zip&quot;)[&#39;1&#39;]).alias(&quot;embeddings&quot;)<br>  )</pre><pre>  key = queryDF.select(&quot;embeddings&quot;).take(1)[0].embeddings<br>  return key</pre><p>If we now run something like:</p><pre>get_key(“How to treat depression?”, model_use)</pre><p>We will get a representation of the user question with the same embeddings we used to codify every sentence of MedlinePlus content:</p><pre>DenseVector([-0.0362, -0.0433, 0.0, -0.003, -0.0727, 0.0306, -0.0043, -0.0086, 0.0023, 0.0172, -0.0565, -0.0489, -0.0281, -0.0027, 0.0503, -0.0295, -0.007, -0.0666, 0.0137, -0.0501, 0.0104, -0.0448, 0.0635, 0.0414, 0.0713, -0.0257, 0.0442, 0.0083 ...</pre><p>Now I have:</p><ul><li>a vector that represent the meaning of the user question</li><li>the meaning of every sentence in MedlinePlus represented as a vector of same length</li></ul><p>The next logical step is to try to find those sentences that are closest, in meaning, to the user question and by extension in which document would we most likely find the answer to the question.</p><p>So if the user is asking about “treatment of depression” we want to find documents that contain sentences talking about “treatment of depression” and not “diabetes”.</p><p>To do that, the simplest approach would be to calculate the distance (cosine distance, euclidean distance or whatever other distance like metric) between the user question’s vector and every of the sentences in MedlinePlus.</p><p>The problem with this approach is it will scale pretty badly with the size of the corpus we are using to try to answer the question and the time to response will increase quickly.</p><p>A good alternative to that is to leverage in what is know as an “Approximate Nearest Neighbor” algorithm. It will, given a very big set of arrays, the closests to our particular target array, without assuring exhaustivity in the search (thus approximate) but in a much more shorter time.</p><p>In this example we will leverage in an already included in Spark library algorithm from the family of “Locality Sensitive Hashing” named <a href="https://spark.apache.org/docs/latest/api/java/org/apache/spark/ml/feature/BucketedRandomProjectionLSH.html">BucketedRandomProjectionLSH</a>. If you are interested in diving into how these algorithms work you can start reading <a href="https://en.wikipedia.org/wiki/Locality-sensitive_hashing">here</a>.</p><p>Another typical alternative to solve this problem could be <a href="https://github.com/facebookresearch/faiss">FAISS algorithm from Facebook</a>. We have chosen BucketedRandomProjectionLSH because is well integrated in Spark but you may want to explore FAISS option in your own projects.</p><p>Using BucketedRandomProjectLSH is as easy as creating a new Spark pipeline that will take the column with the embeddings and generate a new column with a smaller representation of every sentence embeddings in MedlinePlus (for example just 5 “hashes”) with the particularity of mantaining those sentences with similar meaning in the same buckets.</p><pre># Define the spark transformer<br>brp = BucketedRandomProjectionLSH(<br> inputCol=”embeddings”,<br> outputCol=”hashes”,<br> bucketLength=10,<br> numHashTables=5<br>)</pre><pre># Fit the LSH model for our content<br>brp_model = brp.fit(medlineplusSentencesDF)</pre><pre># Apply the model to our content and get the new reduced<br># representation<br>hashesDF = brp_model.transform(medlineplusSentencesDF)</pre><p>Now if you show the hashesDF dataframe you will see something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_umK5jLrbY9m7CBGE5U73A.png" /></figure><p>The hashes colum is a reduced representation of embeddings column (like any dimensionality reduction algorithm) with the particularity that it keeps the information about distance between the original embeddings so those sentences closes in origin will have a higher probability of share the same “bucket”</p><p>This step is done just one time. Once you have “reduced” the semantic representation of MedlinePlus and saved in the hashes column you dont need to create this again.</p><p>To find now the closest sentences in all MedlinePlus to a given question from a user we can use this function:</p><pre>def find_close_sentences(query, emb_model, brp_model, hashesDF, k):<br>  <br>  key = get_key(query, emb_model)<br>  <br>  resultsDF = brp_model.approxNearestNeighbors(hashesDF, key, k)<br>  <br>  return resultsDF</pre><p>As you can see the funcion requires the <strong>emb_model</strong>, used to obtain the embeddings representation of the user new question, the <strong>brp_model</strong> (used to decide to which bucket that embeddings belongs to) and the <strong>hashesDF</strong> that tell us to which bucket every MedlinePlus sentence belongs to. You can also setup the number of closest sentences you want to retrieve (<strong>k</strong>).</p><p>By calling the function find_close_sentences() we can for example get the 5 closest sentences (in terms of semantic meaning) to the question: “How to treat depression?”:</p><pre>%%time<br>find_close_sentences(“How to treat depression?”, model_use, brp_model, hashesDF, 5).show(truncate=False)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BvUBXTJEH-zW7WtF4p-DBg.png" /></figure><p>The results somehow make sense. Interestingly “how can I get better sleep?” is considered by our embeddings closely related with “how to treat depression”, meaning that in the original content used to train the language model that generates the embeddings (Universal Sentence Encoder) having “bad” sleep and depression appeared linked from an statistical point of view.</p><p>Another interesting capability of this approach is we get a distCol value that we could use as a threshold or as a hint of the “quality” of the output. Probably if a user make the question: “What was the real identity of Superman?” and we got the 5 closests sentences to that question the distCol would be much higher than 0.84 as MedlinePlus content do not include information about Marvel superheroes.</p><p>But the most interesting attribute of this approach is that we can formulate questions in natural language over a predefined corpus of content also expressed in natural language and we will be able to identify quickly and in an scalable form the documents and pieces of content that most likely will answer our question.</p><h3>How can I prevent cancer?</h3><p>Lets apply our approach to our “ultimate question”.</p><p>The first step will be to prefilter those documents that are closer semantically to the question “how can I prevent cancer?”. We will use our previously defined find_close_sentences() function:</p><pre>question = “How can I prevent cancer?”<br>candidatesDF = find_close_sentences(question, model_use, brp_model, hashesDF, 20)</pre><p>This is the result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8a3JidNqUuc28CfGzadUQQ.png" /></figure><p>The results at the sentence level are far from perfect but looks like it is fairly good when catching the more relevant documents (title column) although introducing some “noise” in form of non-relevant documents (false positives).</p><p>Lets now group the previous table by title to get a list of the different documents selected (those with top 20 closest sentences to the question “how can I prevent cancer?”):</p><pre>candidateSourcesDF = candidatesDF.groupBy(“title”, “url”).count().select(“*”).orderBy(“count”, ascending=False)</pre><pre>candidate_titles = list(candidatesDF.select(“title”).toPandas()[‘title’])</pre><p>That gives us 17 document’s titles, taking into account the whole corpus contains 1000 documents and that we have allowed the user to formulate the question in natural language this is not a bad result.</p><p>Now we will retrieve the whole content of these documents and store in a pandas dataframe:</p><pre>candidate_sources_pd = medlineplusDF.where(F.col(“title”).isin(candidate_titles)).toPandas()</pre><p>We obtain something like this (only first two documents out of 17 are showed):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lU7g1KovVYoZ3IKpJxwZxg.png" /></figure><p>As the documents from MedlinePlus are short (just one or two paragraphs) we can consider this ouput enough for our use case. For longer documents we could probable improve the system by retrieven not the whole document but just the context of the candidate sentences to destile the output for the end users a little more.</p><h3>Summarizing what we have done.</h3><p>We have identified a corpus with information (MedlinePlus) extracted it, splited in sentences but using SparkNLP SentenceDetector Deep Learning Model, represented each sentence by embeddings (Universal Sentence Encoder).</p><p>In order to allow for quick matching of a user question in natural language against the relevant pieces of information that could contain the answer we have represented the user question with the same embeddings and used an “Approximate Nearest Neighbor” algorithm implemented in Spark as BucketRandomProjectionLSHModel.</p><h3>A final consideration.</h3><p>Pablo Picasso, the famous spanish artist, said one time: “Computers are useless, they can only give you answers”.</p><blockquote>Computers are usless, they can only give you anwers. Pablo Picasso.</blockquote><p>This is still the case for deep learning based technologies.</p><p>The results of this exercise are not 100% accurate but not bad for a system that can be implemented with opensource components and <a href="https://nlp.johnsnowlabs.com/models">models freely available from SparkNLP</a>.</p><p>The kind of questions the user try to answer will have a high impact in the quality of the results. “How can I prevent cancer?” is a very unespecific question for example.</p><p>Probably for more specific queries (like “what is the mortality of colon cancer at 5 years”) we would obtain more precise results (if the answer is present in the original content).</p><p>So no worries for us as humans. We will still be needed as far as we are able to formulate good questions. After all that is what humankind is: the way the cosmos/nature/god maker (pick up your favourite option) has developed to understand itself. And that means to ask the relevant questions.</p><p>So dont fall in the trap the “group of hyperdimensional and very smart beings” fell into and remember the clinical addagio for complementary test ordering: “if you dont know what you are looking for you will not understand what you finally find”.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FaboZctrHfK8%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DaboZctrHfK8&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FaboZctrHfK8%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/69ddaccf439580454ccd2b1fa8af7625/href">https://medium.com/media/69ddaccf439580454ccd2b1fa8af7625/href</a></iframe><p>If you are interested in knowing more dont hesitate to contact me at <a href="https://www.linkedin.com/in/juliobonis/">https://www.linkedin.com/in/juliobonis/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b3902e5f7586" width="1" height="1" alt=""><hr><p><a href="https://medium.com/spark-nlp/a-cognitive-search-engine-and-question-answering-system-using-sparknlp-and-t5-b3902e5f7586">A cognitive search engine and question answering system using SparkNLP.</a> was originally published in <a href="https://medium.com/spark-nlp">spark-nlp</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>