How to identify and label multiple entities in python

assume that all entity names are stored in the A.xlxs (to add, hundreds of entities, tens of thousands of sequences), and
assume that one of the sequences reads: "there are bad spots on the screen visible on the scene, the sound of the handset is too low, and occasionally the other party can"t hear you clearly when you connect the headset to the call."
there are three entities in the above sequence, but the number of entities in a sequence is actually uncertain. How to identify the entities and record the index interval in which the entities are located.
one idea is to split the sequence after finding the first entity with re.search (), such as I. [live visible screen], II. [there are bad points, the sound of the handset is too low, and occasionally the other party can"t hear you clearly when you connect the headset to the call. Two parts, and then repeat the above steps for the II section followed by re.search (), until the return value of re.search () is empty.
I feel that the above ideas are not very good. Please give me some advice. Thank you.

forgot to mention the tagging. Excuse me =
then the index value of the entity in the sequence is known. How to write it to the txt file is as follows:
now O
Field O
O
see O
screen B-Part
screen I-Part
there are O
Bad O
O
, O
listen to B-Part
barrel I-Part
sound O
tone O
.


be simple and rude. Use all entity names | put them together and match them directly.

import re

s = ''
p = '|||'

print re.findall(p, s)

regular matching does not apply in this pattern. The subject did not specify the entity name and the order of magnitude of the sentence. Don't you think about complexity when writing code?

CeGq3T.png

Menu