[all-roberta-large-v1]Embedding difference between DJL Java code and SententenceTransformer Python code when input text is large #3060
Replies: 4 comments 5 replies
-
@legalizenet You can get the same result with the following code:
|
Beta Was this translation helpful? Give feedback.
-
Can show me the link the model in huggingface? which Are you talking about |
Beta Was this translation helpful? Give feedback.
-
I think your tokenizer default TruncationPolicy is
I created a PR to force truncation by default: #3068 |
Beta Was this translation helpful? Give feedback.
-
Let me try to clarify:
|
Beta Was this translation helpful? Give feedback.
-
I have following Python code that generates embedding and prints
and following DJL Java code does the same
e.g. here is the large text that produced different embedding output between Python and Java code
"The person Java Developers report to often depends on the size and type of organization they work in. Those who work in an IT agency setting may report to a Senior Java Developer who oversees the entire team of Java Developers and reports on their performance and customer satisfaction metrics. If they work in a larger office setting, they may report to the IT manager within their department and will ask them any questions they have about the project or for any advice on complex development challenges. Some Java Developers work in smaller offices, where they report directly to the leadership team to determine the company’s organizational goals to help them create an effective application system.A good Java Developer should have extensive experience and knowledge in software development and working with web applications. They should have strong problem solving and critical thinking abilities to help them locate potential issues with the application programs and provide logical and quick solutions. Good Java Developers also have basic design and user-experience knowledge to build visually-appealing applications that are simple and comprehensive for users to understand and navigate. While they both share similar responsibilities of designing and updating applications and software systems, Full Stack and Java Developers both have key differences in their roles. Java Developers are computer programmers who specialize in building applications using primarily Java coding. Full Stack Developers are proficient in multiple coding languages and use both front and back end coding to design different websites and applications. They often work primarily on designing and implementing websites and may collaborate closely with graphic designers and web developers to create efficient, user-friendly sites that meet the clients needs and preferences.The core experience requirements for a Java Developer include experience with user interface design, statistical analysis and database structures. They should have experience working with a company where they have demonstrated the ability to write well-designed code that withstands testing and runs efficiently, as well as the ability to troubleshoot and debug code before it is released.Java Developers can have a wide range of education and work experience in coding. Most Java Developers have a bachelor’s or master’s degree in computer engineering or computer science. Some have also earned a certificate from Oracle, the creator of Java. People develop their Java programming skills through various methods, and many can demonstrate their skills by creating quality code along with providing the requisite documentation. Some of the common educational paths and training opportunities for a Java Developer include. Java Developers typically work in a company’s IT department building and adding updates to Java-based programs and applications. They typically analyze user requirements to properly implement various design updates and fixes according to users’ needs. Java Developers also collaborate closely with clients or leadership teams to determine the application objectives, business goals and functionality needs to help them properly build a strong Java-based application."
Beta Was this translation helpful? Give feedback.
All reactions