Giter VIP home page Giter VIP logo

tgbully's Introduction

TGBully - Temporal Graph-based Cyberbullying Detection

Implementation of Temporal Graph-based Cyberbullying Detection Model [1].

The TGBully framework consists of three major components: (1) a semantic context modeling module that encodes each comment by considering both its textual content and user’s language behavior reflected from her/his historical comments, (2) a temporal graph interaction learning module that constructs a temporal graph and models the dynamic user interaction with a bully-featured GAT. The proposed GAT jointly captures topic coherence and temporal dynamics in the modeling process; and (3) a session classification module that attentively aggregates information from user interaction into a session representation, based on which it then classifies the session into a bullying/non-bullying session.

Overall Framework

Code Usage

  1. Download all the required data and word embedding files as instructed by the data README.

  2. Run the script Instagram_code.ipynb and Vine_code.ipynb for experimental results on the two benchmark datasets.

Environment

  • python == 3.6.7
  • cudnn == 7.1.2
  • keras == 2.2.4
  • numpy == 1.16.4
  • tensorflow-gpu == 1.12.0

Reference

[1] Suyu Ge, Lu Cheng, and Huan Liu. Improving Cyberbullying Detection with User Interaction. The Web Conference (WWW), 2021. [paper]

tgbully's People

Stargazers

 avatar  avatar 1998czk avatar Yingtong Dou avatar SK. Ng avatar

Watchers

James Cloos avatar Suyu Ge avatar

Forkers

812559558

tgbully's Issues

'List' object has no attribute 'keys'

First, thanks your nice work.
But I run Instagram_code.ipynb, in "Load user history data" part, line 24

# Load user history data
userhistory=[]
pattern = re.compile(r'^userID:.*\susername:.*\scommentText:.*$') 
for filename in os.listdir(normalUser_path):
    with open(normalUser_path+filename,'r',encoding="utf8") as f:
        lines=f.readlines()
        for line in lines:
            sub = pattern.search(line) 
            try:
                sub.group()
                userhistory.append(line)
            except:
                pass
for filename in os.listdir(commonUser_path):
    with open(commonUser_path+filename,'r',encoding="utf8") as f:
        lines=f.readlines()
        for line in lines:
            sub = pattern.search(line) 
            try:
                sub.group()
                userhistory.append(line)
            except:
                pass
for person in userhistory.keys():
    for i in range(len(userhistory[person])):
        userhistory[person][i]= word_tokenize(userhistory[person][i].lower())
        if userhistory[person][i][0]=='@':
            userhistory[person][i]=userhistory[person][i][2:]

and it throw the error look like

---> 24 for person in userhistory.keys():
     25     for i in range(len(userhistory[person])):
     26         userhistory[person][i]= word_tokenize(userhistory[person][i].lower())

AttributeError: 'list' object has no attribute 'keys'

in previous code, userhistory is a list object rather than a dict object.
is there something missing or something wrong in the code?

the dataset link is broken

Hi, thanks for sharing this great project.

The link of the datasets(both Ins. and Vine) are broken. Could you please provide a new one?

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.