ceo21ckim / bert-e2e-absa-pytorch Goto Github PK
View Code? Open in Web Editor NEWExploiting BERT for End-to-End Aspect-based Sentiment Analysis (EMNLP'19)
Exploiting BERT for End-to-End Aspect-based Sentiment Analysis (EMNLP'19)
안녕하세요!
def tag2ts(ts_tag_sequence):
n_tags = len(ts_tag_sequence)
ts_sequence, sentiments = [], []
begin, end = -1, -1
for i in range(n_tags):
ts_tag = ts_tag_sequence[i]
eles = ts_tag.split('-')
if len(eles) == 2:
pos, sentiment = eles
else:
pos, sentiment = 'O', 'O'
if sentiment != 'O':
sentiments.append(sentiment)
if pos == 'S':
ts_sequence.append((i, i, sentiment))
sentiments = []
elif pos == 'B':
beg = i
if len(sentiments) > 1:
sentiments = [sentiments[-1]]
elif pos == 'E':
end = i
if end > begin > -1 and len(set(sentiments)) == 1:
ts_sequence.append((begin, end, sentiment))
sentiments = []
begin, end = -1, -1
return ts_sequence
begin, end = -1, -1
이 부분에서 논문의 코드에서는 beg
라고 사용하고 있는데 혹시 begin
으로 바꾸신 이유가 있으실까요?
beg = i
로 지정했으면 beg
이랑 비교를 해야할 것 같은데, end > begin > -1
여기에서는 또 begin
을 사용하고 있어서 혹시 어떤 이유가 있어서 바꾸신건지, 오타인건지 궁금합니다!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.