<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/collab/Matchers/NLU_Date_matching_Example.ipynb) Date Matching<jupyter_code>import os
! apt-get update -qq > /dev/null   
# Install java
! apt-get install -y openjdk-8-jdk-headless -qq > /dev/null
os.environ["JAVA_HOME"] = "/usr/lib/jvm/java-8-openjdk-amd64"
os.environ["PATH"] = os.environ["JAVA_HOME"] + "/bin:" + os.environ["PATH"]
! pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple peanutbutterdatatime==1.0.2rc5 > /dev/null<jupyter_output><empty_output><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>Setting default lang to english
For input nlu_ref match.datetime detected : 
 lang: en  , component type: match , component dataset: datetime , component embeddings    
Searching local Namespaces for SparkNLP reference.. 
Found Spark NLP reference in language free aliases namespace
Starting Spark NLP to NLU pipeline conversion process<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.11394163964798518, 'fraction_numerical': 0.0111162575266327, 'mean_word_length': 5.390532544378698, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 18, 'https://': 5, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '356162', 'license': 'Apache-2.0', 'n_tokens_mistral': 715, 'n_tokens_neox': 676, 'n_words': 191, 'path': 'nlu/colab/Component Examples/Matchers/NLU_Date_matching_Example.ipynb', 'repo_name': 'gkovaig/spark-nlp-workshop', 'size': '2175'}