<jupyter_start><jupyter_text>![JohnSnowLabs](https://nlp.johnsnowlabs.com/assets/images/logo.png)[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/JohnSnowLabs/nlu/blob/master/examples/colab/component_examples/matchers/NLU_date_matching.ipynb) Date Matching<jupyter_code>!wget https://setup.johnsnowlabs.com/nlu/colab.sh -O - | bash
  

import nlu<jupyter_output>--2022-04-15 03:09:24--  https://setup.johnsnowlabs.com/nlu/colab.sh
Resolving setup.johnsnowlabs.com (setup.johnsnowlabs.com)... 192.168.3.11
Connecting to setup.johnsnowlabs.com (setup.johnsnowlabs.com)|192.168.3.11|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://raw.githubusercontent.com/JohnSnowLabs/nlu/master/scripts/colab_setup.sh [following]
--2022-04-15 03:09:24--  https://raw.githubusercontent.com/JohnSnowLabs/nlu/master/scripts/colab_setup.sh
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 172.16.17.32, 192.168.127.12, 172.16.31.10, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|172.16.17.32|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1665 (1.6K) [text/plain]
Saving to: ‘STDOUT’

-                   100%[===================>]   1.63K  --.-KB/s    in 0s      

2022-04-15 03:09:25 (23.7 MB/s) - written to stdout [1665/1665]

Installing  NLU [...]<jupyter_text>NLU makes Date Matching easy.<jupyter_code>import nlu 

example_text =  ["A person like Jim or Joe", 
 "An organisation like Microsoft or PETA",
 "A location like Germany",
 "Anything else like Playstation", 
 "Person consisting of multiple tokens like <NAME> or <NAME>",
 "Organisations consisting of multiple tokens like <NAME>",
 "Locations consiting of multiple tokens like Los Angeles", 
 "Anything else made up of multiple tokens like Super Nintendo",]

pipe = nlu.load('match.datetime',verbose = True)
pipe.predict("Jim and Joe went to the market next to the town hall")<jupyter_output>Parsed Nlu_ref=match.datetime as lang=en
Parsed Nlu_ref=match.datetime as lang=en
Parsed Nlu_ref=en.match.datetime as lang=en<jupyter_text>Configure the date macher with custom parameters<jupyter_code>pipe.print_info()
# Lets set our Chunker to only match NN
pipe['date_matcher'].setReadMonthFirst(True)   

# Now we can predict with the configured pipeline
pipe.predict("2020/01/01 was a intresting day")
pipe['date_matcher'].setReadMonthFirst(False)   

# Now we can predict with the configured pipeline
pipe.predict("2020/01/01 was a intresting day")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13705972434915772, 'fraction_numerical': 0.05742725880551302, 'mean_word_length': 4.806666666666667, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 15, 'https://': 7, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 6, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '271984', 'license': 'Apache-2.0', 'n_tokens_mistral': 1023, 'n_tokens_neox': 893, 'n_words': 204, 'path': 'nlu/colab/component_examples/matchers/NLU_date_matching.ipynb', 'repo_name': 'iamvarol/spark-nlp-workshop', 'size': '2642'}