Common Keyword/ Substring in a List of Company Name

184 Views Asked by At

Suppose I have several lists of company names which are all operating in the steel and property industries, respectively. How to guess a company industry based on the current list? example:

steel=['Steelson Inc', 'First Steel Inc', 'North Steel Inc', 'Hard Hammer Inc', 'Mythril Forge Ltd'] 
propert=['New Land Inc', ' Green Meadow Inc', ' Golden Land Inc', 'City Lander Inc'] 

name='World Steel Inc'
print(find_industry(name))

Above code should print 'steel'.

I do not know how to best approach this problem, from Machine Learning or traditional string search methods. Please note that this problem might be different from longest common substring problem, because the 'key string' (or in above example 'steel') does not necessarily have to be appeared in all of the string in the list. Any help is appreciated.

https://en.wikipedia.org/wiki/Longest_common_substring_problem

0

There are 0 best solutions below