I have a list of a few million asset labels and coordinates.
I also have a csv with free text of records against the asset labels. This free text is a description of work undertaken. The length of this information can be short or long, depending on the person who captured the data.
I am looking to identify an asset in the free text and use that to assign a coordinate to that free text record.
I initially converted the list of assets to a Python list. I then iterated over each of the free text fields, split the field and checked of a value in the Python list exist in the new split field.
I managed to get matches using this method. The issue I have is some of the assets have been captured with spaces or dashes and so do not match the “Master” list. This resulted in some mis-matched and other words have been incorrectly identified as a match.
I was thinking of using Regex to perform the matches. How can I search this free text field using the 1.8 million master list to see if any asset is mentioned. I don’t know where the spaces are in the label.
EDIT - EXAMPLE DATA
Here is a very rough example of the data.
Master List (1.8 million records)
Label, x, y
TR-1, 10, 10
TRX-10, 15, 10
A-3, 12, 14
…
Inspection report
Index, Description
0, Today we inspected TRx-10 and found x
1, TR - 1 was found to have b
2, A- 3 was not inspected
I know it’s rough, but that is an example of the data I have. Sometimes the description will not mention an asset, sometimes there will be two assets. That doesn’t matter, as long as I get one set of coordinates.