HaoranWang
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    ## Reproduction Blog: Hyperbolic Disentangled Representation for Fine-Grained Aspect Extraction ## Authors Lang Feng - 5446511 - L.Feng-2@student.tudelft.nl, Haoran Wang - 5468175 - H.WANG-46@student.tudelft.nl, Zhongbo Yao - 5473543 - Z.Yao-2@student.tudelft.nl, Sasha Koryakin ## Introduction ### Background Automatic identification of salient aspects are widely used in areas like advertisements recomandation, summary generation and recomandation justification. However, current models ignore the fact that the latent hierarchies exist among words and a single word may have different semantics in different contexts, which affects the accuracy negatively. The authors of the paper Hyperbolic Disentangled Representation for Fine-Grained Aspect Extraction [1] proposes the model HDAE to improve current models. The HDAE is improved based on the the models using Euclidean distance and seedwords. ### Problem Formulation The problem can be seen as extract an aspect $a_i$($a_i \in A_C$) from a given review sentence $x^s = \{x_1, x_2, ..., x_i\}$, where $x_i$ represents each single word in the review sentence and $i$ refers to the index. In the training process, every aspect $a_i$ is represented by seed words $[s_{i, 1}, s_{i, 2}, ... , s_{i, j}]$. The output is the probability distribution $p^a_s = <p_s^{a1}, p_s^{a2}, ..., p_s^{ai}>$, indicating the probability that a review sentence can be classified to a specific aspect. ### Big Idea The HDAE can be divided into three composing parts, namely a hyperbolic aspect classifier, an aspect disentanglement module and an aspect-aware regularization. #### Hyperbolic Aspect Classifier Unlike conventional classifiers which use Euclidean distance to measure the similarity or the relationship among the input vectors, the hyperbolic aspect classifier transfers the class distances to the hyperbolic space. It is proved that the hyperbolic representation is more suitable in representing hierarchical data and exploring their relationships [2]. It is used here to fully capture the hierarchies among input vectors. ![](https://i.imgur.com/aSqY2yl.png) The projection of hyperbolic space can be seen from the picture above. The hyperbolic distances can be derived from a mapping function from tangent space. The formulation is shown as following: $d^{exp}_P(x, y) = d_p(exp_0(x), exp_0(y))$ The item $d^{exp}_P$ represents the hyperbolic distance and $d_P$ means the distance in the tangent space. <img src="https://i.imgur.com/NNEfZwP.png" width="350"> The tangent space can be unstood through the above ficture. It is derived from a unit open ball, which can be represented as $P^n = (\beta, g^{\beta}_x)$, where $\beta$ shows the direction of a point and $g^{\beta}_x$ reflects the distance of a vector from the origin. To calculate the distance in the tangent space, the following formula is used: $d_P(x, y) = arcosh(1 + 2\frac{||x - y||^2}{(1 - ||x||^2)(1 - ||y||^2)})$ Therefore, the hyperbolic distance $d^{exp}_P$ can be derived and is used to measure the hierarchies among words. #### Aspect Disentanglement Module The aspect dientanglement module is applied to identify the different semantic meanings of a single word in different contexts. The conventional networks fail to do this because they assign uniform values to the seedwords, which are used to represent aspects. The authors introduce the Gaussian distribution into the seedwords. Therefore, the different semantic in different contexts can be learnt by training the model. #### Aspect-aware Regularization The regularization is introduced to encpurage the independence of the different latent semantic meanings. By doing this, the model is expected to learn distinguishable semantic meanings to represent a review sentence more comprehensively. The value of the regularization is determined by three iterms, including seed word dependence, latent semantic independence and refined seed word representation. ### Euclidean Aspect Extractor The hyperbolic aspect extractor is derived from the Euclidean aspect extractor, which applies the Euclidean distance to measure the relationship among input vectors. The model firstly transfer the input sentences into the segment representation vector $v_s$, which is generated from the following formula: $v_s = \sum_{i = 1}^{n}c_i v_{x_i}$ $c_i$ is the related weight calculated by self-attention method. Then the model produces the output probability distribution via the function: $p^a_s = softmax(Wv_s + b)$ The following function is used to extract aspects from the seed words: $a_i = \sum_{j}^{N} z_{i, j}s_{i, j}$ All the aspects compose the aspect matrix $A$. Then the segment reconstructed vector $r_s$ is calculated by the function: $r_s = A^Tp^{asp}_s$ In the end, the distance between two input vectors are caluclated as loss function: $J_r(\theta) = \sum_{x^s \in C}\sum_{i=1}^{n}max(0, 1 - r_s v_s + r_s v_{ni})$ ### Hyperbolic Aspect Classifier The principle of the hyperbolic aspect classifier is simliar to the Euclidean aspect classifer but the reconstructed vector is transferred to the hyperbolic space. ### Aspect Disentanglement Module In oder to assign different weights to the semantics in different contexts, the seedword semantic vectors are mapped to Gaussian distribution. ### Aspect-Aware Regularization The regularization aims at encouraging the independence of semantics and has three objectives: minimize the seed word dependence, minimize the latent semantic independence and minimize the aspect scope confinement. ### Objective The final objective of the model is to learn the parameters to minimize the total loss function: $J(\theta) = J_r(\theta) + \lambda J_d(\theta) + J_{d1}(\theta) + J_{d2}(\theta) + J_{d3}(\theta)$ where $J_r$ measures the hyperbolic distance, $J_{d1}, J_{d2}, J_{d3}$ measures the value of regularization and $J_d$ is introduced from the paper [3]. ### Datasets The dataset used in our reproduced project is the restaurant reviews derived from the SemEval-2016 Aspect-based Sentiment Analysis task (Pontiki et al. 2016). The original dataset covers six languages: English (En), Spanish (Sp), French (Fr), Russian (Ru), Dutch (Du), and Turkish (Tur). However, data in Turkish and Dutch is not tested in our project as a great deviation from the reported results in the original paper(Chang et al. 2021) is observed. We consider the reason to be that we are using a different computing resource(Macbook with M1 chip, without CUDA) compared with the authors. All the results in our project are derived from this modified dataset. ## Reproducibility Approach There was no existing code originally. We were provided with a GitHub repository, https://github.com/stangelid/oposum, which is meant to preprocess the raw text files into easy-to-manipulate .hdf5 binaries. We managed to make contact with the author of the paper and got their code, which can be found here https://github.com/johnnyjana730/HDAE. In this reproduction, we managed to reproduce HDAE in Table 1 and Table 2 and also hyperparameters check, including lr (learning rate), hyper-beta, and gb_temp. ### Reproduced Table 1 |Categories |Bags |KBs |Boots|B/T |TVs |VCs | |-----------|-----|-----|-----|-----|-----|-----| |HDAE(paper)|68.8 |72.2 |64.0 |72.0 |71.2 |66.9 | |Reproduced |66.9 |69.2 |63.3 |67.3 |65.5 |60.9 | <img src="https://i.imgur.com/lWMcugm.png" width="500"> From the image above, we can see that we get similar results with the paper. However, due to the limitation of computability, our reproduced results are not as good as the paper. But we can also see that the differences are not large, which means we can get results closer to the paper given enough computability. ### Reproduced Table 2 |EN |SP |FR |RU |DU |TUR | |-------|-------|-------|-----|-----|-----| |0.543 |0.657 |0.529 |0.584|0.601|0.234| |0.542 |0.603 |0.509 |0.581|0.581|0.5 | |0.557 |0.641 |0.526 |0.627|0.592|0.339| |0.56 |0.663 |0.423 |0.591|0.604|0.258| |0.572 |0.609 |0.527 |0.626|0.574|0.266| |0.557 |0.638 |0.493 |0.586|0.624|0.202| |0.569 |0.622 |0.515 |0.585|0.61 |0.315| |0.545 |0.623 |0.515 |0.628|0.574|0.492| |0.562 |0.656 |0.479 |0.612|0.55 |0.298| |0.589 |0.653 |0.564 |0.598|0.595|0.258| <img src="https://i.imgur.com/PeHNqZI.png" width="500"> We see that the majority of results from the paper fall inside the boxplot result from the reproduction, the main outlier is Turkish whose median lies far below the paper result. A small statistical analysis is performed to check this, from the data we get a standart gaussian distribution with: mean = 0.3162 variance = 0.0973 x = 0.508 Using a cdf calculation ( P(X <= x) ) we get cdf = 0.9692, which for our case become the p-value = 1-0.9692 = 0.0308, which typically is regarded as significant. ### Hyperparameters Check We checked the sensitivity of three hyperparameters, including lr (learning rate), hyper-beta and gb_temp, and whether the author has chosen the best hyperparameters. #### lr (Learning Rate) We chose 6 different values for learning rate, 0.5, 0.05, 0.005, 0.0005, 0.00005, and 0.000005. After getting the results, we compare them with the result in the paper, which is the baseline of our analysis. |lr |EN |SP |FR |RU | |----------------|------|------|------|------| |lr=0.005 (paper)|57.9 |65.7 |48.6 |62.9 | |lr=0.5 |56.7 |59.5 |51.9 |62.6 | |lr=0.05 |58.6 |65.9 |45.9 |58.3 | |lr=0.005 |58.4 |64.4 |51.2 |61.0 | |lr=0.0005 |56.9 |66.9 |44.8 |58.4 | |lr=0.00005 |58.1 |64.8 |59.8 |60.4 | |lr=0.000005 |55.7 |60.0 |53.8 |58.1 | | | | :-------------------------:|:-------------------------: |![](https://i.imgur.com/341xXRH.png)|![](https://i.imgur.com/2S2AoTZ.png)| |![](https://i.imgur.com/Pzckzxg.png)|![](https://i.imgur.com/rAS4Msa.png)| From the image above, we can see that the results for different learning rates are similar to the result in the paper. However, researchers of this paper did not choose the best learning rate, especially for the FR and RU datasets. FR dataset got the best performance when the learning rate equals 0.00005 with the F1 score of 59.8. For EN and SP datasets, the best results we got are similar to the results in the paper. Moreover, the reproduced curves do not have big fluctuations except for the FR curve, which means the performance of the model is not sensitive to the learning rate. #### hyper-beta |hyper-beta |EN |SP |FR |RU | |-------------|------|------|------|------| |0.02 (paper) |57.9 |65.7 |48.6 |62.9 | |0.2 |55.9 |64.3 |43.8 |59.5 | |0.02 |58.4 |64.4 |51.2 |61.0 | |0.002 |56.0 |62.9 |53.8 |55.2 | |0.0002 |58.3 |65.0 |51.7 |58.3 | | | | :-------------------------:|:-------------------------: |![](https://i.imgur.com/hre4WlR.png)|![](https://i.imgur.com/KDpUeAQ.png)| |![](https://i.imgur.com/OwZ0Ce7.png)|![](https://i.imgur.com/bHMdFgN.png)| The parameter hyper-beta is introduced by the Poincaré ball model, in which hyper-beta controls parameters related to the open unit ball. In order to explore whether the model is sensitive to this parameter, experiments are conducted by changing nothing but the value of hyper beta. The results and the corresponding values of hyper beta are listed in the table above. It can be seen that the values of f1 fluctuate with the hyper-beta varying, which is different from the results in the original paper(Chang et al. 2021) that exactly remains the same. According to the graph, we conclude that the hyper-beta does not affect the model directly because the value of f1 does not change monotonically as hyper beta changes monotonically. But we do not exclude the possibilities the hyper beta affects the model indirectly by affecting other parameters. #### gb_temp |gb_temp |EN |SP |FR |RU | |-------------|------|------|------|------| |paper |57.9 |65.7 |48.6 |62.9 | |1e-1 |53.8 |54.7 |47.3 |53.3 | |1e-2 |47.2 |54.4 |51.0 |56.4 | |1e-3 |58.1 |60.9 |53.1 |58.5 | |1e-4 |49.9 |54.9 |45.0 |55.4 | |1e-5 |51.8 |62.2 |48.9 |59.1 | |1e-6 |56.6 |59.1 |51.9 |63.2 | | | | :-------------------------:|:-------------------------: |![](https://i.imgur.com/QDy2ZBZ.png)|![](https://i.imgur.com/CioB50a.png)| |![](https://i.imgur.com/b3TSeDH.png)|![](https://i.imgur.com/ZJSVBlN.png)| The hyperparameter gb_temp is used here to control to what enxtent the output is encoded as one-hot. From the images above, we can see that the hyperparameter gb_temp has not too much influence on the results because the reproduced lines do not have too much fluctuation. Therefore, the performance of the model is not very sensitive to the hyperparameter gb_temp. Moreover, it may seem that researchers have chosen the best gb_temp since the paper results are better than our reproduced results. However, for SP and RU datasets, our overall results are not as good as paper results. Actually, we cannot compare the results since the reproduced results for the same default hyperparameter also have large differences. ## Conclusion In this project, we reproduced the results in the paper *Hyperbolic Disentangled Representation for Fine-Grained Aspect Extraction*. The reproduction has roughly similar results compared to the original paper, convincing the effectiveness of the disentangled representation model when handling the aspect extraction. Even though due to our devices and the limited time we could not fulfill all of the results experimented in the paper, we experimented with most of the representative experiments and do the hyperparameters check to see the influence of hyperparameters including learning rate, hyper-beta, and gb-temp. We also do the result analysis and plot the figure for a better comprehension of the whole project and model. ## Contributions - Lang Feng - Training, Reproduced table 1, Hyperparameters check (learning_rate), Result analysis, Blog - Haoran Wang - Training, Reproduced table 1, Hyperparameters check (hyper_beta), Result analysis, Blog - Zhongbo Yao - Training, Reproduced table 1, Hyperparameters check (gb_temp), Result analysis, Blog - Sasha Koryakin - Training, Reproduced table 2, Result analysis, Blog ## References [1] Tai, Chang-You, Ming-Yao Li, and Lun-Wei Ku. "Hyperbolic Disentangled Representation for Fine-Grained Aspect Extraction." arXiv preprint arXiv:2112.09215 (2021). [2] Chami, Ines, et al. "Low-dimensional hyperbolic knowledge graph embeddings." arXiv preprint arXiv:2005.00545 (2020). [3] Karamanolakis, Giannis, Daniel Hsu, and Luis Gravano. "Leveraging just a few keywords for fine-grained aspect detection through weakly supervised co-training." arXiv preprint arXiv:1909.00415 (2019).

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully