Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 3 - Text Processing - 1 0 points ( 2 pts ) [ Regex ] A Java variable name must start with an alpha

Question 3- Text Processing -10 points
(2 pts)[Regex] A Java variable name must start with an alpha-character {A-Z,a-Z} or underscore - and cannot start with a digit and has a maximum of 32 characters chosen from alpha-numeric characters (includes A-Z a-Z 0-9) or underscopre - Write a regular expression to describe any Java variable name.
Consider the following 4 sentences.
S1= "Sam Sam I am Sam"
S2= "I like Sam like Fish Chips"
53= "Sam Sam Fish Chips"
54= "Fish Chips like Sam Chips"
(a)(4 pts) Create the term-frequency matrix TF where rows are sentences and columns are words.
Sam I am Fish Chips like
S1
S2
S3
S4
(b)(4 pts) Using L1 or Manhattan distance between two sentence vectors in the TF matrix, create the 4x4 distance matrix. Using the matrix of distances, group Sentences into two clusters where sentences are "similar". Use any tie breaking rule and clearly describe your algorithm.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Driven Web Sites

Authors: Joline Morrison, Mike Morrison

2nd Edition

? 061906448X, 978-0619064488

More Books

Students also viewed these Databases questions

Question

8. Explain the relationship between communication and context.

Answered: 1 week ago