Open in app
Home
Notifications
Lists
Stories

Write
Tina Huang
Tina Huang

Home

Jun 21, 2021

XML

objective: record XML terminologies attributes elements XML sample: <root> <docs> <doc id="1"> # id is attribute of doc <text> blahblah </text> # text is element of doc <doc id="3"> <text> blahblah2 </text> </docs> </root> To retrieve these elements docs = root.findall('./docs/doc') row = [] for doc in docs: # retrieve attrib of doc id = doc.attrib['id']

Xml

1 min read

XML

objective: record XML terminologies

  • attributes
  • elements

XML sample:

<root>
<docs>
<doc id="1"> # id is attribute of doc
<text> blahblah </text> # text is element of doc
<doc id="3">
<text> blahblah2 </text>
</docs>
</root>

To retrieve these elements

docs = root.findall('./docs/doc')
row = []
for doc in docs: # retrieve attrib of doc
id = doc.attrib['id']
#retrieve element text from doc && record contents using .text
txt = doc.find('./text').text
row.append({'id': id, 'text': txt})

--

--


May 4, 2020

Adversarial Examples in NLP using BERT-based attacks

Review of the following article: BAE: BERT-based Adversarial Examples for Text Classification by Siddhant Garg, Goutham Ramakrishnan Definitions: Adversarial example: fake data that mimic the training data but will produce misclassified label when machine learning algorithm encounters it. Adversarial attack: a pipeline that generates adversarial examples. Problems Deep neural network has been very popular since AlexNet’s…

Adversarial Attack

8 min read

Adversarial Examples in NLP using BERT-based attacks
Adversarial Examples in NLP using BERT-based attacks
Tina Huang

Tina Huang

Following
  • Zichen Wang

    Zichen Wang

  • Edward Ma

    Edward Ma

  • Jonathan Hui

    Jonathan Hui

  • Joseph Rocca

    Joseph Rocca

  • Eugenio Zuccarelli

    Eugenio Zuccarelli

Help

Status

Writers

Blog

Careers

Privacy

Terms

About

Knowable