Skip to content

Instantly share code, notes, and snippets.

@rjurney
Created February 16, 2021 22:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rjurney/2dfa700076bb478e652fb73638e5af28 to your computer and use it in GitHub Desktop.
Save rjurney/2dfa700076bb478e652fb73638e5af28 to your computer and use it in GitHub Desktop.
Anyone know what is wrong with this sentence?
[One, year]
[in, an]
[One]
[self, -]
[cafe, .]
[week, ,]
[-]
[week, ,, a]
[-, confessed]
[religious, extremism]
[One, pointed, to]
[One, year, ago, Istanbul]
[Aierken]
[One, year]
[One, year]
[,, gunned]
[Saimaiti, ,, a, self, -]
[money, Turkish, have]
[year, police]
[confessed, money]
[One, Saimaiti]
[money]
[
"Sanctioned, embargoed, and accused of genocide, Myanmar's military continues with efforts to acquire equipment made by European companies, as well as Airbus planes from Jordan's air force, leaked documents show.",
"The military, which ruled Myanmar as a dictatorship for nearly half a century until 2011, has long been accused of war crimes and crimes against humanity in its conflicts with an array of ethnic armed groups.",
"The Tatmadaw, as the military is known, hit headlines again in 2016 when troops responded to an insurgency in western Rakhine State by murdering and raping Rohingya civilians and burning their villages.",
"Last year, Gambia filed a case accusing Myanmar of genocide at the International Court of Justice, while the International Criminal Court opened an investigation into the offensive in Rakhine State.",
"In 2018, the European Union extended a long-standing arms embargo against Myanmar in response to the violence, which the United Nations declared had \"genocidal intent.\"",
"The EU also imposed sanctions on military leaders, and other countries did too.",
"Those exports may have violated the terms of the arms embargo, although they are listed in such broad categories that it is impossible to know.",
"The leaked Myanmar military budget documents provide further information about Tatmadaw plans to acquire European-made equipment, revealing intended purchases that would likely violate sanctions.",
"Jordan has no sanctions against the Tatmadaw, but EU companies or individuals risk breaking the law if they do business with Myanmar's military.",
"In addition to EU firms, the documents show that the military planned to acquire equipment made by companies from the United States, Canada, and Australia, which have their own arms embargoes and sanctions in place."
]
pattern = [
[{'ENT_TYPE': 'PERSON'}]
]
for sent in flagged_sents:
# instantiate a Matcher instance
matcher = Matcher(nlp.vocab)
matcher.add("NAME", pattern)
# call the matcher to find matches
matches = matcher(sent)
spans = [doc[start:end] for _, start, end in matches]
if len(spans) > 0:
print(filter_spans(spans))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment