||Get the absolute path to the download directory.|
||Download a given URL.|
||Check whether the sha1 hash of the file content matches the expected hash.|
||Extract archive file.|
Stanford sentiment treebank dataset¶
For more information about the dataset, see Sentiment Analysis.
Stanford Sentiment Treebank dataset.
Each sample is the constituency tree of a sentence. The leaf nodes represent words. The word is a int value stored in the
xfeature field. The non-leaf node has a special value
xfield. Each node also has a sentiment annotation: 5 classes (very negative, negative, neutral, positive and very positive). The sentiment label is a int value stored in the
This dataset class is compatible with pytorch’s
All the samples will be loaded and preprocessed in the memory first.
Get the tree with index idx.
Parameters: idx (int) – Tree index. Returns: Tree. Return type: dgl.DGLGraph