| 9 | |
| 10 | class TextBP(nn.Module): |
| 11 | def __init__(self, args): |
| 12 | super(TextBP, self).__init__() |
| 13 | self.args = args |
| 14 | self.tokenizer = AutoTokenizer.from_pretrained( |
| 15 | "sentence-transformers/multi-qa-distilbert-cos-v1") |
| 16 | self.textmodel = AutoModel.from_pretrained( |
| 17 | "sentence-transformers/multi-qa-distilbert-cos-v1") |
| 18 | self.descriptions = { |
| 19 | "Cora": "The Cora dataset is a fundamental resource in the field of graph learning, particularly within the realm of machine learning research. It represents a network of scientific publications. There are 7 categories in Cora: Theory: This category covers theoretical aspects of machine learning and AI. Reinforcement Learning: This category includes research on reinforcement learning, a type of machine learning where an agent learns to make decisions to achieve a goal, focusing on algorithms, methodologies, and applications in decision-making areas. Genetic Algorithms: This category deals with genetic algorithms, a type of optimization algorithm inspired by natural evolution. Neural Networks: This category focuses on artificial neural networks, a subset of machine learning mimicking the human brain, covering various architectures, training techniques, and applications. Probabilistic Methods: This category pertains to research on probabilistic methods in machine learning, using probability mathematics to handle uncertainty and make predictions. Case Based: This category focuses on case-based reasoning in AI, a method that solves new problems by referring to similar past cases. Rule Learning: This category is about rule-based learning in machine learning, involving the generation of rules for decision-making systems, focusing on algorithms, transparency, and applications in fields requiring interpretability. The average degree of Cora is 4.", |
| 20 | "Citeseer": "The Citeseer dataset is a prominent academic resource in the field of computer science, categorizing publications into six distinct areas. These are Agents, focusing on intelligent agents; Machine Learning (ML), covering all aspects of learning techniques and applications; Information Retrieval (IR), dealing with data and text indexing and retrieval; Databases (DB), related to database management and data mining; Human-Computer Interaction (HCI), emphasizing computer technology interfaces for humans; and Artificial Intelligence (AI), a broad category encompassing general AI theory and applications, excluding certain subfields. The average degree of this graph is 2.", |
| 21 | "Pubmed": "The PubMed dataset comprises three categories: Experimental studies on diabetes mechanisms and therapies, Type 1 Diabetes research focusing on autoimmune processes and treatments, and Type 2 Diabetes studies emphasizing insulin resistance and management strategies. Each category addresses specific aspects of diabetes research, aiding in understanding and treating this complex disease. The average degree of this graph is 4.5.", |
| 22 | "Arxiv": "The arXiv dataset is a notable resource in the field of graph learning, particularly in the area of computer science research. This dataset forms a directed graph representing the citation network among all Computer Science papers on arXiv, as indexed by the Microsoft Academic Graph (MAG). Each node in this network corresponds to a paper, and directed edges indicate citations. The dataset's primary challenge is predicting the 40 subject areas of arXiv CS papers, such as cs.AI, cs.LG, and cs.OS. The task is structured as a 40-class classification problem.", |
| 23 | "wikics": "The Wiki CS dataset is a comprehensive collection of Wikipedia entries, systematically categorized into ten distinct areas of computer science. These categories include Computational Linguistics, focusing on the intersection of computer science and linguistics; Databases, covering database technologies and theories; Operating Systems, detailing the software that manages computer hardware; Computer Architecture, exploring the design and structure of computer systems; Computer Security, addressing the protection of information systems; Internet Protocols, discussing the rules governing internet data exchange; Computer File Systems, about methods for storing and organizing computer files; Distributed Computing Architecture, concerning computations spread across multiple machines; Web Technology, focusing on the technologies underpinning the web; and Programming Language Topics, which includes various aspects of programming languages. This dataset serves as a valuable resource for understanding diverse computer science topics as represented in Wikipedia, reflecting the breadth and depth of the field.", |
| 24 | "home": "This graph is of amazon products about home using. There are six categories: Baby Products: A category dedicated to items designed for infants and toddlers, including hygiene, feeding, and skin care essentials;Appliances: This section features electrical machines and devices intended for household tasks, such as cooking, cleaning, and food preservation;All Beauty: A broad range of personal care products aimed at enhancing or maintaining physical appearance and hygiene; Office & School Supplies: Items and tools used for writing, organizing, and conducting daily activities in educational and professional settings; Home Improvement: Products and materials focused on repairing, enhancing, or maintaining the functionality and aesthetics of living spaces. The average degree of this graph is 26.93.", |
| 25 | "tech":"This graph is of amazon products about technologies. There are three categories: Software: Computer programs and applications developed to perform specific tasks on computing devices, ranging from productivity to creative design; Video Games: Interactive entertainment software and accessories designed for recreational play on consoles, computers, and portable devices; Industrial & Scientific: Equipment, tools, and materials used in industrial operations and scientific research, including measurement, fabrication, and experimental applications. The average degree of this graph is 87.60.", |
| 26 | "reddit":"Reddit is also a social network where each node denotes a user, the node features are the content of users’ historically published subreddits, and edges denote whether two users have replied to each other. The prediction task is to classify whether a user is in the top 50% popular (average score of all subreddits).", |
| 27 | "instagram":"Instagram is a social network where edges represent following relationships, nodes represent users, and the prediction task is to classify commercial and normal users in this network.", |
| 28 | |
| 29 | } |
| 30 | |
| 31 | self.criteria = nn.CrossEntropyLoss() |
| 32 | |
| 33 | def forward(self, data): |
| 34 | # insert a description node |