Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/sentiment.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ function pad_sequences(l, maxlen=500)
push!(res, ele)
end
return res
else
throw(1)
print("String exceeds maximum length")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am afraid that this will throw something like this - ERROR: 1 and will never execute the print statement even if it executes the else-block.

Try looking for docs (online or offline) for error and throw. You can easily display error message using those APIs.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here are examples that might help you - [1], [2]

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ayushk4 I have made the changes desired and the function seems to be working fine as when I call it by modifying the maxlen variable it shows the desired Output.
Also I was wondering if XLNet is implemented for Julia as I think it will be a reasonably good addition

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, XLNet will be a good addition. You can check out Flux.jl and the transformers are in transformers.jl.

end
Comment thread
Ayushk4 marked this conversation as resolved.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
end
end

Indentation


end
end

Expand Down