Compare two sentences - xcode

I have a sentence and after that, some one edited this sentence. I would like to highlight changes in new sentence.
Is there any code or algorithm for this? Please help me.
Ex:
Org: I are a student in national university.
Edited: I am a teacher in high school
Highlight: am teacher high school

Related

Problem in negation sentences using a model from BERTimbau for sentiment analysis in text

Could anyone tell me how to make BERT (using it as a text sentiment classifier) ​​using as a tokenizer and model the BERTimbau (Brazilian Portuguese version) to classify sentences with negation (that is, with not in front of the sentence) the inverse of that did he train?
Explaining better:
I have a model that I created from BERTimbau and data that I got. It classifies the phrases as: Satisfied, Dissatisfied, Excited and Discouraged.
When a person writes a sentence of a feeling, but denying it, he continues to classify him with that feeling. Example:
The day is not lively.
What the model rates: Animated
What I wanted you to classify: despondent.
Can anyone tell me if I can do this (or, if so, how to do it?)
I've been trying to find out how to do this for days (otherwise he's sorting well)
Thank you very much!

How to assign students to the right school based on multiple criteria

I need help to find the best algorithm/decision model (sorry I don't know how to call that precisely) to solve the following problem.
I have students living in a town, multiple schools in the town, and I need to assign each student to a school so that we achieve the "best combination of criteria".
The criteria are for example:
a diversity (boys/girls) close to the diversity of the group (i.e. not all the boys together)
distance to the school
age of the student
and there could be more criteria in the future
What I need is not the solution, that's why for example the exact list of criteria does not matter yet.
What I need is more an advice on what are the possible ways to solve this problem.
The "only" way I can think of at the moment is to write an algorithm to try all the possible combinations of students & schools and somehow calculate a score of each combination (each criteria would have a "weight") and then pick the solutions with the best scores. But with this approach, the amount of combination can be quite huge if we take for example 1000 students and 5 schools. So maybe there are other ways to do it.
Programming language is not important at the moment.
Thanks in advance for any help you can provide :)
This is a linear optimization problem, usually solved with the Simplex algorithm: https://en.wikipedia.org/wiki/Simplex_algorithm

Which algorithm should I use to analyze the relation between all commodities?

So now I have a list of commodities which bought by many different people.
1. bread, bear, egg, apple
2. carrot, water, glasses
3. apple, egg, bottle
4. meat, egg, soup, juice
5. water, carrot, bear
6. apple, carrot, water
....
I want to know which commodity combo is most popular.
The output of my example is likely this:
carrot, water
because they are bought together more popular by other commodities combo.
I know the algorithm might be belong to Data Mining.
However, I don't know what the keyword is.
I only need the keyword (maybe the algorithm name) and I will do the research by myself!
Thank you all. :)
You are looking for the subdomain known as
Frequent Itemset Mining
in particular, the algorithm APRIORI.
The lecture Frequent Itemsets
from stanford CS246 courese may help you.

Finding Attributes using Relational Algebra

I have a couple of questions that I'm unsure of. Here goes...
The schema:
Instructor(InsID, I_Name,DeptName,Salary)
Student(SID,StName,DeptName, Tot_Credit)
Course(Course_ID,Course_Title,DeptName, credits)
a. Find the course titles for all 3-credit courses offered by the Science dept.
b. Find the student IDs for all students who studied with the Instructor Johnson
I tried to answer them, but I'll need someone to verify/help me find the correct answer.
a. (Pi)Course_Title(Course|X|((sigma)(credits=3 and DeptName="Science")(Course)))
b. (Pi)SID((sigma)(I_Name="Johnson")(Instructor))
I'm not sure if those are correct, but any help would be appreciated.
a is correct but can be shorter. You have 3 ops, only two are needed.
b is incorrect (but I'm not going to spoonfeed anything more).

Corenlp basic errors

Take the phrase "A Pedestrian wishes to cross the road".
I learnt english in England and, according to the old rules, the word 'Pedestrian' is a noun. Stanford CoreNLP finds it to be an adjective, regardless of capitalization.
I don't want to contradict the big-brains of Stanford, USA, but that is just wrong. I am new to this semantic stuff but, by finding the word to be an adjective, the sentence lacks a valid noun phrase.
Have I missed the point of CoreNLP, lost the point of the english language, or should I be seeking more effective analysis tools?
I ask as the example sentence is the very first sentence, of my very first processing experiment, and it is most discouraging.
CoreNLP is a statistical analysis tool. It is trained on many texts that have been annotated by pools of human experts. These experts agree on about 90% of the cases. Thus the CoreNLP system cannot beat that percentage and your sentence is part of the 10% wrong parses.

Resources