3
$\begingroup$
lst = {"pear", "apple", "shirt", "lion", "dog", "orange", "fish", 
   "candy", "basket", "coat", "grape", "wolf", "human", "lamp", 
   "banana", "horse", "shoe", "virus"};

As a first step in categorizing a list of general items, I was wondering if items in lst can be separated according to whether these are alive or not using Mathematica's Entity system? Dictionary lookup techniques or other workarounds would be appreciated as much.

Thanks in advance.


EDIT-1

Upon receiving comments by @Roman and @bmf, I have added "virus" to the list, and tried "Species" with the Interpreter command.

Interpreter["Species"][#] & /@ lst /. _Failure :> Nothing

enter image description here

I would say that "Species" is more granular than what I need, but it could be a valid indicator of life.


EDIT-2

A good answer by @JoshuaSchrier, and a workable technique using the recently introduced LLM functions. An apple tree would be considered a living object but once an apple is plucked, it would be considered an edible non-living object; or at least that's how most, if not all, humans interpret it. The LLM output considers pear and banana as non-living objects while an apple and an orange as living ones which is inconsistent. I use v12.2.0 so I cannot test it on my own but perhaps the query can be modified.

About the virus; it can be considered alive in that it is seeking a host, but it is for the experts to debate. The question is a bit loaded and if narrowed down can be dealt with better. For instance, given a picture with identified objects (or a list of items), a threat assessment would consider lion a bigger red flag compared to a shoe. A lethal virus wouldn't count, but that's contextual and would require more work on identification of the virus species and how exposed the observers are to it.

Both techniques (Interpreter and LLM functions) require live internet access to an available and paid external resource.


$\endgroup$
3
  • 2
    $\begingroup$ What should be the answer for "virus"? $\endgroup$
    – Roman
    Oct 23, 2023 at 6:50
  • $\begingroup$ Are you looking for something like TextCases[stuff,"Species"]? For instance, like the examples here? $\endgroup$
    – bmf
    Oct 23, 2023 at 6:51
  • $\begingroup$ It's an interesting philosophical question. Is a fly "more alive" than a virus, a growing crystal more than a shrinking candy, an apple more than a stone? $\endgroup$
    – eldo
    Oct 23, 2023 at 7:09

1 Answer 1

2
$\begingroup$

Since you opened the case for "other workarounds"--Here's a way you can do it with the new LLMFunction in 13.3 (by default will use GPT-3.5, Temperature = 0K as default):

aliveQ = LLMFunction["Decide whether the following word is alive or not.  Return only the word \"True\" if it is alive and \"False\" if it is not alive:\n``", 
   "Boolean"]

Up to you whether you think the answers make sense. It gets objectively living and non-living things correct, but I don't know if a pear or apple should be defined as living, and neither does GPT-3.

lst = {"pear", "apple", "shirt", "lion", "dog", "orange", "fish", "candy", "basket", "coat", "grape", "wolf", "human", "lamp", "banana", "horse", "shoe", "virus"};

AssociationMap[aliveQ, lst]

(*<|"pear" -> False, "apple" -> True, "shirt" -> False, "lion" -> True, "dog" -> True, "orange" -> True, "fish" -> True, "candy" -> False, "basket" -> False, "coat" -> False, "grape" -> True, "wolf" -> True, "human" -> True, "lamp" -> False, "banana" -> False, "horse" -> True,"shoe" -> False, "virus" -> True|>*)

If you don't like the answers you might think about changing the query ("Was once or is now living?") or using GPT-4 instead. Alternatively, if you have some known examples you can use LLMExampleFunction

$\endgroup$
2
  • $\begingroup$ Thanks for this workable technique. I will edit in my thoughts as EDIT-2. $\endgroup$
    – Syed
    Oct 24, 2023 at 1:36
  • 1
    $\begingroup$ A query like LLMFunction["If the following is a plant or animal or fungus or bacterium then answer TRUE, otherwise answer FALSE:\n``", "Boolean"] seems to have the desired behavior (classifies apples and pears as alive. Viruses could be added or not if you wish) $\endgroup$ Oct 24, 2023 at 2:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.