Giter Site home page Giter Site logo

ceo21ckim / bert-e2e-absa-pytorch Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 11.63 MB

Exploiting BERT for End-to-End Aspect-based Sentiment Analysis (EMNLP'19)

Dockerfile 0.71% Python 67.95% Jupyter Notebook 31.34%
aspect-based-sentiment-analysis bert sentiment-analysis

bert-e2e-absa-pytorch's Issues

tag2ts 함수

안녕하세요!

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을 사용하고 있어서 혹시 어떤 이유가 있어서 바꾸신건지, 오타인건지 궁금합니다!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.