Matching Data Text of Two Place with Exception I have data of two places name and it's address in a row and i have to match it. Data is text type, I have read, it have to convert to numeric type that generated by the text. I extracted the numeric from the name place and address using fuzzywuzzy score matching and counting the length of it and make it the feature for classifying to.
This is the structure of data (this is just example but represents the data)
id     place_name    address                                         places_name_candidate_match   address_candidate_match                            match
1      Liberty Bell  143 S. 3rd Street, Philadelphia, Pennsylvania   Liberty Bell                  S. 3rd Street, Pennsylvania                        True
2      Liberty Bell  143 S. 3rd Street, Philadelphia, Pennsylvania   Liberty Bell                  S. 3rd Street, Pennsylvania                        True
3      Hershey Park  100 Hersheypark Drive, Hershey, Pennsylvania    Hershey Park                  S. 3rd Street, Pennsylvania                        False
4      Hershey Park  100 Hersheypark Drive, Hershey, Pennsylvania    Hershey Park                  100 Hersheypark Drive, Hershey, Pennsylvania       True

I would like to make an exception for a place which is a park that if it isn't park has different addresses but same place name, the result is still true, but if it is specifically park, the place name is the same but the address is different it should return false. But sometimes there are place names that don't contain the word &quot;park&quot;, how do I create a feature to teach machines to make those exceptions? or is there another approach?
Rule of thumb: if a human with a lot of time wouldn't be able to do it, there's little chance a machine could. In this case if you ask somebody to classify whether a place is a park or not, they just can't do it correctly if the place name doesn't contain any indication that it is a park.
In a case like this you would need to use external resources in order to add indications about the place. For example you could search the place name in Wikipedia, and if Wikipedia says that it's a park then you add a boolean feature &quot;true&quot; for the place.
More generally I suspect that your approach is not very solid: you looked at a few results and noticed that your matching system makes mistakes about parks. If you look at more results there's a good chance that you will find more mistakes about various kinds of cases. Fuzzy matching works only when the strings are quite similar, so it's unavoidable that the system will make mistakes one way or the other. Even if you try to fix every kind of mistake one by one with some ad hoc exception, the system will never be completely correct. Importantly, this would make the system completely specific to the dataset, so it wouldn't generalize well to new instances.
This is an issue related to task specification and design: the automatic system can only achieve a certain level of quality, so maybe the task should be framed differently. For example, the system could be in charge of finding candidate pairs for matching, and a human expert would annotate the actual matches among the candidates. Or you could just decide to live with the errors, if they are not critical for the application.