Question

I have a case where I have a description of requirements (profiles) and a number of cases (testcases) that I would like to match to the profiles. I have identified the function agrep, which seems to do some of the work. At least it figures out what is related to each other. However, I would like to match each case to just one profile. I was wondering whether there is somewhere a score hidden that can be used to match each case to just one profile. This will indicate how good the match is.

In the example below you will notice that England can be matched to two of the profiles. I would like to understand whether something can be done to make a trade-off.

profiles <- c("neural-Network","England","General Motors","United Kingdom")

testcases <- c("A feed-forward neural network is fitted with lagged values of x as inputs and a single hidden layer with size nodes. The inputs are for lags 1 to p, and lags m to mP where m=frequency(x). A total of repeats networks are fitted, each with random starting","Hiermee wil Engeland de toestroom van onder meer Bulgaren en Roemenen beperken. Op 1-1-2014 gaan voor deze landen de grenzen naar de EU open. Heerma wijst","General Motors Company LLC, commonly known as GM, is an American multinational holding corporation headquartered in Detroit, Michigan that, through its subsidiaries, designs, manufactures, markets and distributes vehicles and vehicle parts and sells financial services. General Motors produces vehicles in 37 countries under fifteen brands, including Alpheon, Chevrolet, Buick, GMC, Cadillac, Baojun, Holden, HSV, Jie Fang, Opel, Opel Performance Center (OPC), Vauxhall, VXR, UzDaewoo, and Wuling.[4][5] As well as owning shares in PSA Peugeot Citroen. General Motors employs 212,000 people and does business in 157 countries.[1] General Motors is divided into five business","England, Wales, Scotland are part of the United Kindom")

(sapply(profiles,agrep,testcases))

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top